ImageGear v26.5 - Updated
ImageGear.Core Assembly / ImageGear.Processing Namespace / ImGearProcessing Class / Rotate Method / Rotate(ImGearPage,Double,ImGearRotationModes,ImGearPixel) Method
Image to rotate.
Rotation angle in degrees.
Rotation mode. ImGearRotationModes.CLIP means that the image size is not changed during rotation and the part of picture out of image boundary is cut. ImGearRotationModes.EXPAND changes the image size according to the new picture boundary.
Background color to fill the out of picture area. Can be null (Nothing in VB NET).
Example




In This Topic
    Rotate(ImGearPage,Double,ImGearRotationModes,ImGearPixel) Method
    In This Topic
    Rotates an image.
    Syntax
    'Declaration
     
    Public Overloads Shared Sub Rotate( _
       ByVal page As ImGearPage, _
       ByVal angle As Double, _
       ByVal mode As ImGearRotationModes, _
       ByVal background As ImGearPixel _
    ) 
    'Usage
     
    Dim page As ImGearPage
    Dim angle As Double
    Dim mode As ImGearRotationModes
    Dim background As ImGearPixel
     
    ImGearProcessing.Rotate(page, angle, mode, background)
    public static void Rotate( 
       ImGearPage page,
       double angle,
       ImGearRotationModes mode,
       ImGearPixel background
    )
    public: static void Rotate( 
       ImGearPage* page,
       double angle,
       ImGearRotationModes mode,
       ImGearPixel* background
    ) 
    public:
    static void Rotate( 
       ImGearPage^ page,
       double angle,
       ImGearRotationModes mode,
       ImGearPixel^ background
    ) 

    Parameters

    page
    Image to rotate.
    angle
    Rotation angle in degrees.
    mode
    Rotation mode. ImGearRotationModes.CLIP means that the image size is not changed during rotation and the part of picture out of image boundary is cut. ImGearRotationModes.EXPAND changes the image size according to the new picture boundary.
    background
    Background color to fill the out of picture area. Can be null (Nothing in VB NET).
    Remarks
    This method processes all channels of the image as well as image's ROI, if it exists.

    Background should be in the same color space as the Page, including Alpha and Extra channels. Background must have the same channel count and bit depth as a DIB?s color space.

    Use CanApplyRotate method to check whether the operation can be performed.

    Example
    // Find the skew angle of an image.
    double angle = ImGearRasterProcessing.FindSkewAngle(igRasterPage);
    
    // Rotate image by the found skew angle.
    ImGearProcessing.Rotate(igRasterPage, angle, ImGearRotationModes.CLIP, null);
    ' Find the skew angle of an image.
    Dim angle As Double = ImGearRasterProcessing.FindSkewAngle(igRasterPage)
    
    ' Rotate image by the found skew angle.
    ImGearProcessing.Rotate(igRasterPage, angle, ImGearRotationModes.CLIP, Nothing)
    See Also