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_ex(
HIGEAR hIGear,
HWND hWnd,
DWORD dwGrpID,
ART_MARK_INDEX hMarkIndex,
const LPART_BLOCK_NAME lpBlockName,
LPVOID lpBlockData,
DWORD dwBlockSize
);
|
Arguments:
hIGear | HIGEAR handle to the image. |
hWnd | HWND handle to the window. |
dwGrpID | Identifier of group. |
hMarkIndex | Mark identifier. |
lpBlockName | 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 | A far pointer to the Block to copy into a new named block. |
dwBlockSize | 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 Professional.
Sample:
Annotation
Example:
Copy Code | |
---|---|
HIGEAR hIGear; /* HIGEAR handle of image */ AT_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 */ HWND hWnd; DWORD dwGrpID; /* 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 */ dwGrpID = IG_GRP_DEFAULT; nErrcount = ART_mark_block_create_ex(hIGear, hWnd, dwGrpID, 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.