Resize an image to the specified size
PhImage_t *PiResizeImage( PhImage_t *image, PhRect_t const *bounds, short w, short h, int flags )
- A pointer to a PhImage_t structure that defines the image to be resized.
- A pointer to a PhRect_t structure specifying a rectangle within image to resize, effectively cropping the image before resizing. Pass as NULL to resize the whole image.
- w, h
- The width and height of the new image.
- Flags that dictate special behavior of the resizing process and can take on the following values:
- Free the original image if the resizing succeeds.
- Store the newly created image data in shared memory. This is useful if fast rendering of the image is required.
- Don't the calculate CRC tag. If this flag bit isn't set, the image's image_tag is filled in with a CRC calculated by PtCRC().
- Use the original image's color palette. If this flag bit isn't set, the function calculates a new, optimized palette.
This function resizes a Photon image, making it larger or smaller. It allocates space for the resulting image, leaving the original image untouched. If you set the Pi_FREE flag bit, the function frees the old image by setting all its release flags and calling PhReleaseImage() on it.
A pointer to the new, resized image on success, or NULL if an error occurred.
For an example that uses this function, see PiConvertImage().
“Images” in the Raw Drawing and Animation chapter of the Photon Programmer's Guide