ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > General Image Functions > IG_image_create_empty

This function creates a new empty image that does not have pixel data allocated.


Copy Code
AT_ERRCOUNT ACCUAPI IG_image_create_empty(
       HIGEAR* lphIGear


Name Type Description
hDIB HIGDIBINFO DIB info object with parameters used to create image.
lphIGear HIGEAR* Returned HIGEAR handle of created image.

Return Value:

Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

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


Copy Code
    // Create a new image with the same parameters as an existing image,
    // but with no pixel data allocated 
    AT_ERRCOUNT nErrcount;  // Number of errors on stack
    HIGEAR hIGear;          // Handle of image
    HIGDIBINFO hDIB;        // DIB info handle of image
    HIGEAR hIGearCreated;   // Handle of created image

    // Load image file "picture.bmp" from working directory
    nErrcount = IG_load_file("picture.bmp", &hIGear);
    if(nErrcount == 0)
        // Get DIB info of the existion image
        // DIB info can be also created and filled in manually
        nErrcount = IG_image_DIB_info_get(hIGear, &hDIB);
        if(nErrcount == 0)
            nErrcount = IG_image_create_empty(hDIB, &hIGearCreated);
            // Destroy DIB info 
            // ...
            // Destroy the image
        // Destroy the source image

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