ImageGear Professional v18.2 > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image DIB Functions > IG_image_DIB_export_size_calc |
This function calculates the size of the exported DIB for an image.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_image_DIB_export_size_calc( const HIGEAR hIGear, AT_INT* lpDIBSize, const AT_DIB_EXPORT_OPTIONS* lpOptions ); |
Name | Type | Description |
hIGear | const HIGEAR | HIGEAR handle of image for which to calculate exported DIB size. |
lpDIBSize | AT_INT* | Pointer to where exported DIB size will be stored. |
lpOptions | const AT_DIB_EXPORT_OPTIONS* | Export options. See IG_image_DIB_export for details. |
If lpOptions->Format is IG_DIB_EXPORT_FORMAT_WINDOWS:
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrcount; // Number of errors on stack HIGEAR hIGear; // Handle of image AT_INT nDibSize; // Exported DIB size AT_DIB_EXPORT_OPTIONS Options; // Options for DIB export // Load image file "picture.bmp" from working directory nErrcount = IG_load_file("picture.bmp", &hIGear); if(nErrcount == 0) { // Get exported DIB size, allocate memory buffer and export DIB memset(&Options, 0, sizeof(AT_DIB_EXPORT_OPTIONS)); Options.Format = IG_DIB_EXPORT_FORMAT_IG_LEGACY; Options.UseAlpha = FALSE; IG_image_DIB_export_size_calc(hIGear, &nDibSize, &Options); // ... } // Destroy the image IG_image_delete(hIGear); |
Use this function to calculate the minimal buffer size required to export a DIB with IG_image_DIB_export.