ImageGear Professional DLL v17.1 for Windows Accusoft
ART_mark_block_create
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > ART Component API Reference > ART Component Functions Reference > Named Block Management Functions > ART_mark_block_create

Glossary Item Box

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:

hIGear HIGEAR handle to the image.
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 */
/* 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:

©2012. Accusoft Corporation. All Rights Reserved.