ImageGear for C and C++ on Windows v20.1 - Updated
IG_DIB_raster_size_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > DIB Functions > IG_DIB_raster_size_get

This function calculates and returns the number of bytes required to hold a line (raster) from the image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_DIB_raster_size_get(
        HIGEAR hIGear, 
        AT_MODE nFormat, 
        LPAT_DIMENSION lpSize
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of the image.
nFormat AT_MODE Format in which the raster data is stored: IG_PIXEL_PACKED, IG_PIXEL_UNPACKED, IG_PIXEL_RLE.
lpSize LPAT_DIMENSION A far pointer to a variable in which the size of the raster line (in bytes) is returned.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

Pixel Access

Remarks:

You can use this function to determine the size of a block of memory to allocate before using IG_DIB_raster_get(), to avoid data overflow. The returned size will include allocation for buffering at the end of the rasters. (See the section Device-Independent Bitmaps (DIB) for more information on buffering in DIBs.) The nFormat variable determines in what form you would like to store the pixels in. The size will vary according to the storage method.

Is this page helpful?
Yes No
Thanks for your feedback.