ImageGear Professional DLL v17.1 for Windows Accusoft
IG_IP_rotate_compute_size
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image Processing Effects Functions > IG_IP_rotate_compute_size

Glossary Item Box

This function computes the new width and height of the image after it has been rotated using IG_IP_rotate_any_angle, IG_IP_rotate_any_angle_bkgrnd, or IG_IP_rotate_any_angle_ex functions.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_IP_rotate_compute_size(
   HIGEAR hIGear,
   DOUBLE angle,
   AT_MODE rotate_mode,
   LPAT_DIMENSION lpWidth,
   LPAT_DIMENSION lpHeight
);

Arguments:

hIGear HIGEAR handle of image of which to compute size.
angle Angle by which to rotate the image, in degrees. Positive values result in clockwise rotation; negative values result in counter-clockwise rotation.
rotate_mode Rotation mode. Specifies whether the image should be clipped or expanded. See enumIGRotationModes for possible values.
lpWidth Pointer in which is returned the new width of the bitmap after rotation.
lpHeight Pointer in which is returned the new height of the bitmap after rotation.

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

Sample:

None

Example:

  Copy Code
HIGEAR hIGear;            // HIGEAR handle of the image
AT_ERRCOUNT nErrcount;    // Count of errs on stack upon ret from func
AT_DIMENSION nWidth, nHeight;  // New height and width of image


// Load image file "picture.bmp" from working directory
nErrcount = IG_load_file("picture.bmp", &hIGear);
if(nErrcount == 0)
{
    nErrcount = IG_IP_rotate_compute_size(hIGear, 45., IG_ROTATE_EXPAND, &nWidth, &nHeight);
    // ...
    // Destroy the image
    IG_image_delete(hIGear);
}

Remarks:

You may use this function before rotation in IG_ROTATE_EXPAND mode to determine the dimensions of the new rotated image. This way, you can estimate the amount of memory that will be needed to hold the new image.

©2012. Accusoft Corporation. All Rights Reserved.