This function queries a global named block for its data returning it in lpBlockData.
Declaration:
|
Copy Code
|
AT_ERRCOUNT ART_global_block_query(
HIGEAR hIGear,
const LPART_BLOCK_NAME lpBlockName,
LPVOID lpBlockData,
LPDWORD lpBlockSize
);
|
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 that specifies the type of block to query. The block type is either an ART-defined constant beginning with ART_BLOCK or a user-defined block. See ARTAPI.H file for the full list of ART-defined constants. |
lpBlockData |
LPVOID |
A far VOID pointer which returns block data. |
lpBlockSize |
LPDWORD |
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:
None
Example:
|
Copy Code
|
HIGEAR hIGear; /* HIGEAR handle of image */
LPVOID blockData; /* data in global block */
DWORD blockSize; /* size of block, in bytes */
AT_ERRCOUNT nErrCount; /* number of errors on the */
/* error stack */
/* get the block size */
nErrCount = ART_global_block_query(hIGear,
ART_BLOCK_GROUP, NULL, &blockSize);
blockData = (LPVOID)alloca(blockSize);
/* but the data into blockData */
nErrCount = ART_global_block_query(hIGear,
ART_BLOCK_GROUP, blockData, &blockSize);
|
Remarks:
The buffer pointed to by lpBlockData must be large enough to fit the named block data. The size of the block is returned by lpBlockSize.
To find the size of a buffer necessary to hold the block data, call ART_global_block_query() with lpBlockData set to NULL. lpBlockSize returns the size of the block.
An error is set if any of the following conditions are met:
- hIGear does not reference a valid ImageGear handle.
- lpBlockName does not point to a valid address.
- lpBlockData does not point to a valid address or is not NULL.
- lpBlockData points to a buffer smaller than the block data.
- lpBlockSize points to an invalid address.
- lpBlockSize points to a value smaller than the size of the block data.