QPx_RotatePicture
QPx_RotatePicture(pictVar; pictVar; pictVar; pictVar):error | |||
---|---|---|---|
![]() |
pictVar | Picture | Picture variable |
![]() |
numDegrees | Real | Rotation degrees |
![]() |
rotateOptions | Longint | Options |
![]() |
backColor | Longint | Background color |
![]() |
error | Longint | Error result |
Rotate a picture variable by a number of degrees
The source picture is passed in the pictVar parameter. The source picture may be compressed or uncompressed. The rotated picture is also returned in the pictVar parameter and is always uncompressed. If an error occurs, pictVar is set to an empty picture.
The rotation degrees are specified in the numDegrees parameter. Positive values cause clockwise rotation, negative values rotate the picture counter-clockwise.
The rotateOptions parameter is optional. It can be used to specify options for the rotation operation. The following constants can be combined with bitwise "OR".
qpx_RotateHighQuality | 0x0004 | High quality rotation |
qpx_RotateFillBackground | 0x0800 | Fill background with specified color |
Parameter backColor is also optional, and is meaningful only when the qpx_RotateFillBackground is specified in rotateOptions. It specifies the fill color of the background area when rotating by non-multiples of 90 degrees. 4D's 0xRRGGBB notation is used.
TIP Decompress a compressed picture with a zero-degree rotation!
Example
// Rotate gOriginalPicture by gDegrees and get // the result in gRotatedPicture C_PICTURE($pict) C_LONGINT($error) C_REAL(gDegrees) $pict:=gOriginalPicture $error:=QPx_RotatePicture ($pict;gDegrees) If ($error=qpx_noErr) gRotatedPicture:=$pict End if