L_INT LBitmap::HighQualityRotate(nAngle, uFlags, crFill)
Rotates 1-bit (bitonal) images with high quality.
Hundredths of degrees to rotate (+/-). This can be a number from 0 to 36,000. Positive values rotate the image in a clockwise direction, while negative values rotate the image in a counter-clockwise direction.
Flag that specifies whether to keep the resulting image the same size as the original image or to resize according to the rotation direction specified. Possible values are:
Value | Meaning |
---|---|
ROTATE_RESIZE | [0x0001] Size the resulting image. |
HIGHQUALITYROTATE_HIGH | [0x0000] Rotate the image with high quality.(this is faster than best quality) |
HIGHQUALITYROTATE_BEST | [0x0010] Rotate the image the image with the best quality. |
HIGHQUALITYROTATE_CROP | [0x0000] Do not resize the image. Crop it. |
HIGHQUALITYROTATE_RESIZE | [0x0001] Use high qualiity resize. |
A COLORREF value representing the color of the backgrounds. You can specify the value, such as the return value of the Windows RGB macro, or use the PALETTEINDEX macro to specify a palette color.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function has the following features:
It works only with 1-bit images.
It uses the center of the image as the center of rotation.
It can rotate the image clockwise or counterclockwise up to 360 degrees in 1-degree increments.
It can resize the image to accommodate the rotated height and width, or it can retain the original height and width, cropping the bitmap as necessary.
It uses crFill as the background color to fill any new area created by the rotation.
If ROTATE_RESIZE is set, then the image is resized. Otherwise, the image is cropped.
To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.
Win32, x64.
L_INT LBitmap__HighQualityRotateBitmapExample(LBitmap & LeadBitmap)
{
L_INT nRet;
/* Load the bitmap, keeping the bits per pixel of the file */
nRet = LeadBitmap.Load(TEXT("C:\\LEADTOOLS21\\Resources\\Images\\OCR1.TIF"));
if(nRet !=SUCCESS)
return nRet;
nRet = LeadBitmap.HighQualityRotate(2500, HIGHQUALITYROTATE_RESIZE | HIGHQUALITYROTATE_HIGH,RGB(255,255,255));
if(nRet !=SUCCESS)
return nRet;
nRet = LeadBitmap.Save(TEXT("C:\\LEADTOOLS21\\Resources\\Images\\Result.BMP"), FILE_BMP, 24, 0, NULL);
if(nRet !=SUCCESS)
return nRet;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document