This function gets the first block name.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ART_mark_block_first( HIGEAR hIGear, ART_MARK_INDEX hMarkIndex, LPART_BLOCK_NAME lpBlockName ); |
Arguments:
hIGear | HIGEAR handle to the image. |
hMarkIndex | Mark identifier. |
lpBlockName | A far pointer to an 8-byte array of memory that returns the type of block of the mark referenced by hMarkIndex. The block type is either an ART-defined constant beginning with ART_BLOCK or a user-defined block. See ARTAPI.H for the full list of ART-defined constants. |
Return Value:
Returns the number of ImageGear errors that occurred during the function call.
Supported Raster Image Formats:
All pixel formats supported by ImageGear Professional.
Sample:
Annotation
Example:
Copy Code | |
---|---|
HIGEAR hIGear; /* HIGEAR handle of image */ ART_MARK_INDEX hMarkIndex; /* index to mark */ ART_BLOCK_NAME lpBlockname; /* type of block */ /* to return */ CHAR szFileName[_MAX_PATH]; /* file name buffer */ DWORD dwBlockSize; /* size of a named Block */ nErrcount = ART_mark_block_first(hIGear, hMarkIndex, &lpBlockName); while (*lpBlockName) { if (!memcmp(lpBlockName, ART_BLOCK_FILENAM, sizeof(ART_BLOCK_NAME)) { nErrcount = ART_mark_block_query(hIGear, hMarkIndex, &lpBlockName, (LPVOID)szFileName, &dwBlockSize); if (!strcmp(szFileName, "Clown.tif")) { nErrcount = RT_mark_send_to_back(hIGear, hMarkIndex); } } nErrcount = ART_mark_block_next(hIGear, hMarkIndex, &lpBlockName); } |
Remarks:
The block data for the named block retrieved by calling ART_mark_block_query(). ART_mark_block_next() is called to get the name of the next named block. If there are no blocks, ART_mark_block_first() sets lpBlockName to zero.
Many of ART's callback functions include the index number as a parameter. As part of your callback function, you can call ART_mark_block_first() and ART_mark_block_next() using the mark index that was passed in. |
An error is set if any of the following conditions are met:
- hIGear does not reference a valid ImageGear handle. There are no marks with a matching index block.
- lpBlockName does not point to a valid address.