ImageGear for C and C++ on Windows v19.4 - Updated
ART_mark_block_create_ex
API Reference Guide > ART Component API Reference > ART Component Functions Reference > Named Block Management Functions > ART_mark_block_create_ex

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:

Name Type Description
hIGear HIGEAR HIGEAR handle to the image.
hWnd HWND HWND handle to the window.
dwGrpID DWORD Identifier of group.
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 LBVOID 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 */
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: