ImageGear for C and C++ on Windows v20.0 - Updated
IG_IP_rotate_multiple_90
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image Processing Functions > IG_IP_rotate_multiple_90

This function will rotate the image referenced by hIGear at an angle that is a multiple of 90 degrees.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_IP_rotate_multiple_90(
   HIGEAR hIGear,
   AT_MODE nMult_90_Mode
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image to rotate.
nMult_90_Mode AT_MODE A constant that specifies rotation angle. See enumIGRotationValues

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++.

Sample:

Image Processing, Timing, Medical

Example:

 
Copy Code
HIGEAR hIGear;            // HIGEAR handle of the image
AT_ERRCOUNT nErrcount;    // Count of errs on stack upon ret from func

// Load image file "picture.bmp" from working directory
nErrcount = IG_load_file("picture.bmp", &hIGear);
if(nErrcount == 0)
{
    nErrcount = IG_IP_rotate_multiple_90(hIGear, IG_ROTATE_90);
    // ...
    // Destroy the image
    IG_image_delete(hIGear);
}

Remarks:

The function rotates the image about its center point.

If the rotation is either 90 or 270 degrees, the previous width of the image becomes the new height, and the previous height of the image becomes the new width. IG_ROTATE_0 does nothing and is included for completeness only.

To rotate by an arbitrary angle that may not be a multiple of 90 degrees, use IG_IP_rotate_any_angle_ex.

The function does not swap vertical and horizontal DIB resolutions. If vertical and horizontal resolutions are different, rotation by 90 or 270 degrees will cause the image to display out of original proportions. Use IG_IP_rotate_multiple_90_opt function with SwapResolutions field of lpRotateOptions parameter set to TRUE to swap the resolutions during rotation and preserve the proportions.

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