This function creates a resized copy of the image. It can be used for creating a thumbnail (small preview version of the image).
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_IP_thumbnail_create_ex( HIGEAR hOriginalImage, LPHIGEAR lphNewThumbnail, AT_DIMENSION nNewWidth, AT_DIMENSION nNewHeight, AT_MODE nInterpMethod, DWORD dwFlags, INT nValue ); |
Name | Type | Description |
---|---|---|
hOriginalImage | HIGEAR | HIGEAR handle of image of which to create thumbnail image. |
lphNewThumbnail | LPHIGEAR | Pointer to a variable of type HIGEAR to receive the HIGEAR handle of the created thumbnail image. |
nNewWidth | AT_DIMENSION | Specifies width wanted for the new image. |
nNewHeight | AT_DIMENSION | Specifies height wanted for the new image. |
nInterpMethod | AT_MODE | Specifies interpolation method to use for image resizing. See enumIGInterpolations for possible values. |
dwFlags | DWORD | The contents of this parameter depends upon the value of nInterpMethod. This is currently not used. |
nValue | INT |
The contents of this parameter depends upon the value of nInterpMethod:
|
If nInterpMethod is IG_INTERPOLATION_GRAYSCALE, IG_INTERPOLATION_PRESERVE_WHITE, or IG_INTERPOLATION_PRESERVE_BLACK:
If nInterpMethod is IG_INTERPOLATION_AVERAGE or IG_INTERPOLATION_BILINEAR:
All pixel formats supported by ImageGear for C and C++, except:
If nInterpMethod is IG_INTERPOLATION_BICUBIC:
All pixel formats supported by ImageGear for C and C++, except:
Otherwise, all pixel formats supported by ImageGear for C and C++.
Copy Code
|
|
---|---|
HIGEAR hIGear; // HIGEAR handle of the image HIGEAR hIGearThumb; // HIGEAR handle of the thumbnail image AT_ERRCOUNT nErrcount; // Count of errs on stack upon ret from func // Load image file "picture.tif", 1 bpp, from working directory nErrcount = IG_load_file("picture.tif", &hIGear); if(nErrcount == 0) { nErrcount = IG_IP_thumbnail_create_ex(hIGear, &hIGearThumb, 64, 64, IG_INTERPOLATION_GRAYSCALE, 0, 50); if(nErrcount == 0) { // ... // Destroy the thumbnail image IG_image_delete(hIGearThumb); } // Destroy the image IG_image_delete(hIGear); } |
This function works in the same way as IG_IP_resize_ex with the only difference that it returns a resized copy of the original image, instead of changing the original image. See IG_IP_resize_ex for additional details.