This function creates or replaces a named block and associates a new block with the annotation mark pointed to by hMarkIndex.
Declaration:
|
Copy Code
|
AT_ERRCOUNT ART_mark_block_create(
HIGEAR hIGear,
ART_MARK_INDEX hMarkIndex,
const LPART_BLOCK_NAME lpBlockName,
LPVOID lpBlockData,
DWORD dwBlockSize
);
|
Arguments:
Name |
Type |
Description |
hIGear |
HIGEAR |
HIGEAR handle to the image. |
hMarkIndex |
ART_MARK_INDEX |
Mark identifier. |
lpBlockName |
const LPART_BLOCK_NAME |
Tells ART what type of block to create. Use an ART-defined constant beginning with ART_BLOCK. See ARTAPI.H for the full list. This parameter is also a user-defined block type. |
lpBlockData |
LPVOID |
A far pointer to the Block to copy into a new named block. |
dwBlockSize |
DWORD |
Size of lpBlockdata (in bytes). |
Return Value:
Returns the number of ImageGear errors that occurred during the function call.
Supported Raster Image Formats:
All pixel formats supported by ImageGear for C and C++.
Sample:
Annotation
Example:
|
Copy Code
|
HIGEAR hIGear; /* HIGEAR handle of image */
ART_MARK_ATTRIBUTES ma; /* mark attributes structure */
ART_POINTS lpPoints; /* screen coordinates */
ART_MARK_INDEX hMarkIndex; /* index to mark getting */
/* new block */
DWORD dwBlockSize; /* size in bytes of block */
/* set the block size */
dwBlockSize = sizeof(ART_POINTS) + sizeof(AT_POINT);
/* allocate memory for the points structure */
lpPoints = (LPART_POINTS)LocalAlloc(LPTR,
(UINT)dwBlockSize);
/* initialize to zero */
memset(lpPoints, 0, (UINT)dwBlockSize);
/* fill the structure */
lpPoints->lMaxPoints = 2;
lpPoints->lPoints = 2;
lpPoints->ptPoint[0].x = (ma.rcBounds.right -
ma.rcBounds.left) - 1;
lpPoints->ptPoint[0].y = 0;
lpPoints->ptPoint[1].x = 0;
lpPoints->ptPoint[1].y = (ma.rcBounds.bottom -
ma.rcBounds.top) - 1;
/* create the named block and associate it with this */
/* mark */
nErrcount = ART_mark_block_create(hIGear, hMarkIndex,
ART_BLOCK_ANODAT, lpPoints, dwBlockSize);
|
Remarks:
If a block of type lpBlockName exists, the new one replaces the previous one. The block data pointed to by lpBlockData is copied into the new named block.
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.
- lpBlockData does not point to a valid address.
- There is not enough memory to allocate dwBlockSize bytes of memory.