Documentation / Marblecore Imaging / Methods / Straighten
Straighten method
Straightens the image with the specified number of degrees (with a maximum of 45 degrees) with high precision and quality to align the horizon of an image. Use this method for horizon correction.
Syntax
Boolean Straighten(nDegrees As Number (floating point), nBackgroundColor As Number, nBackgroundOpacity As Number)
Return value
Returns true if the function succeeded.
Parameters
Parameter | Type | Required | Description |
nDegrees | Number (floating point) | Yes | Specifies the number of the degrees to rotate. Can be any value between -45.0 and 45.0. |
nBackgroundColor | Number | No | Optional parameter which specifies the background color. If omitted, the default background color will be used. |
nBackgroundOpacity | Number | No | Optional parameter which specifies the opacity of the background color. |
Example
The example below shows the effect of this method and how to use it. You can slide the marker in the before/after picture to see the difference. If you take a look at the example code, assume there is a reference to the Marblecore Imaging object with the name 'MarblecoreImaging'. Transparent parts of the image are displayed using a checkerboard pattern.
1
2 MarblecoreImaging.LoadFromFile("example-straighten-before.jpg");
3
4
5 MarblecoreImaging.Straighten(2);
6
7
8 MarblecoreImaging.SaveToFile("example-straighten-after.jpg");
Category
Transformations
See also
Clear |
Crop |
Expand |
FlipHorizontal |
FlipVertical |
Opacity |
Resize |
Rotate |
RotateLeft |
RotateRight |
RoundEdges |
Shear |
Shrink |
Skew |
Thumbnail