PiResizeImage()

Resize an image to the specified size

Synopsis:

PhImage_t *PiResizeImage( PhImage_t *image,
                          PhRect_t const *bounds,
                          short w,
                          short h,
                          int flags )

Arguments:

image
A pointer to a PhImage_t structure that defines the image to be resized.
bounds
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
Flags that dictate special behavior of the resizing process and can take on the following values:
Pi_FREE
Free the original image if the resizing succeeds.
Pi_SHMEM
Store the newly created image data in shared memory. This is useful if fast rendering of the image is required.
Pi_SUPPRESS_CRC
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().
Pi_USE_COLORS
Use the original image's color palette. If this flag bit isn't set, the function calculates a new, optimized palette.

Library:

ph

Description:

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.

Returns:

A pointer to the new, resized image on success, or NULL if an error occurred.

Examples:

For an example that uses this function, see PiConvertImage().

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhCreateImage(), PhImage_t, PhRect_t, PiConvertImage(), PiCropImage(), PiDuplicateImage(), PiFlipImage()

Images in the Raw Drawing and Animation chapter of the Photon Programmer's Guide