ImageGear Professional > 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( HIGDIBINFO hDIB, HIGEAR* lphIGear ); |
Name | Type | Description |
hDIB | HIGDIBINFO | DIB info object with parameters used to create image. |
lphIGear | HIGEAR* | Returned HIGEAR handle of created image. |
All pixel formats supported by ImageGear Professional.
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 IG_DIB_info_delete(hDIB); // ... // Destroy the image IG_image_delete(hIGearCreated); } // Destroy the source image IG_image_delete(hIGear); } |