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

This function creates a new global named block, or replaces an existing one.

Declaration:

 
Copy Code
AT_ERRCOUNT ART_global_block_create(
        HIGEAR hIGear, 
        const LPART_BLOCK_NAME lpBlockName, 
        const LPVOID lpBlockData, 
        DWORD dwBlockSize
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle to the image.
lpBlockName const LPART_BLOCK_NAME A far pointer to an 8 byte array of memory into which you set the type of block to create. The block type will be 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.
lpBlockData const LPVOID A far pointer of type VOID which points to the block data.
dwBlockSize DWORD The 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
/* set the block size   */
dwBlockSize = sizeof(ART_ARROW) + sizeof(AT_POINT);
/* allocate memory for the arrow structure */
lpArrow = (LPART_ARROW)alloca((UINT)dwBlockSize);
/* initialize to zero   */
memset(lpArrow, 0, (UINT)dwBlockSize);
lpArrow->lArrowType  = ART_ARROW_POINTER;
lpArrow->lArrowEnd  = 0;
lpArrow->lArrowAngle = 15;
lpArrow->lArrowLength = 25;
/* create the named block and associate  */
/* it with this mark   */
ART_global_block_create(hIGear, ART_BLOCK_ANODAT, 
lpArrow, dwBlockSize);
break;

Remarks:

If a block of type lpBlockName exists, it is replaced by the new one. The block data pointed to by lpBlockData is copied into the new named block.

Unlike mark named blocks, which are associated with an individual mark, global named blocks are not associated with any mark - they act as default settings for the next created mark. When a new mark is created, some of its named blocks are created from the global named blocks.

You may create your own global named blocks to store user-defined data.

An error is set if any of the following conditions are met: