Marblecore Imaging Library Documentation

Documentation Introduction
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.


Boolean Straighten(nDegrees As Number (floating point), nBackgroundColor As Number, nBackgroundOpacity As Number)

Return value

Returns true if the function succeeded.


nDegreesNumber (floating point)YesSpecifies the number of the degrees to rotate. Can be any value between -45.0 and 45.0.
nBackgroundColorNumberNoOptional parameter which specifies the background color. If omitted, the default background color will be used.
nBackgroundOpacityNumberNoOptional parameter which specifies the opacity of the background color.


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 // Load the specified image in memory
2 MarblecoreImaging.LoadFromFile("example-straighten-before.jpg");
4 // Execute the operation
5 MarblecoreImaging.Straighten(2);
7 // Save the modified image to the specified file
8 MarblecoreImaging.SaveToFile("example-straighten-after.jpg");



See also

Clear | Crop | Expand | FlipHorizontal | FlipVertical | Opacity | Resize | Rotate | RotateLeft | RotateRight | RoundEdges | Shear | Shrink | Skew | Thumbnail