Corrects the image by removing the translation, rotation, and scaling deformations that have been applied on the image.
#include "ltwrappr.h"
virtual L_INT LBitmap::ApplyTransformationParameters (nXTranslation, nYTranslation, nAngle, uXScale, uYScale, uFlags)
The amount of bitmap translation along the x-axis (Width). This value is internally divided by 100. This value must be equal to the one returned from LBitmap::GetTransformationParameters function.
The amount of bitmap translation (in pixels) along the y-axis (Height). This value is internally divided by 100. This value must be equal to the one returned from LBitmap::GetTransformationParameters function.
Hundredths of degrees to rotate (+/-). This can be a number from 1 to 36,000. This value is internally divided by 100. A positive value means the image rotated in a clockwise rotation, while a negative value means the image is rotated in a counter-clockwise rotation. This value must be equal to the one returned from LBitmap::GetTransformationParameters function.
The amount of bitmap x-axis (Width) scaling. This is a percentage value (internally divided by 100). This value must be equal to the one returned from LBitmap::GetTransformationParameters function.
The amount of bitmap y-axis (Height) scaling. This is a percentage value (internally divided by 100). This value must be equal to the one returned from LBitmap::GetTransformationParameters function.
Flag that specifies the behavior when resizing the bitmap. Select one value. Possible values are:
Value | Meaning | |
---|---|---|
RGS_SIZE_NORMAL | [0x0001] Resize normally. | |
RGS_SIZE_RESAMPLE | [0x0002] Use linear interpolation and averaging to produce a higher-quality image. | |
RGS_SIZE_BICUBIC | [0x0003] Use bicubic interpolation and averaging to produce a higher quality image. This is slower than SIZE_RESAMPLE. | |
RGS_SIZE_FAVORBLACK | [0x0010] (Document/Medical only) Preserve black objects when making the image smaller. This option affects only 1-bit, black-and-white images, where it prevents the disappearance of thin lines. You can use a bitwise OR ( | ) to combine this flag with another one. For example, RGS_SIZE_RESAMPLE | RGS_SIZE_FAVORBLACK causes color images to be resampled, but applies the favor-black option to 1-bit, black-and-white images. |
RGS_SIZE_FAVORWHITE | [0x0020] (Document/Medical only) Preserve white objects when making the image smaller. This option affects only 1-bit, black-and-white images, where it prevents the disappearance of thin lines. You can use a bitwise OR ( | ) to combine this flag with another one. For example, RGS_SIZE_RESAMPLE | RGS_SIZE_FAVORWHITE causes color images to be resampled, but applies the favor-white option to 1-bit, black-and-white images. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function corrects the image by removing the translation, rotation, and scaling deformations that have been applied to the image. These transformations make this bitmap match a reference bitmap.
This function is designed to work with LBitmap::GetTransformationParameters.
You can get the translation, rotation, and scaling parameters by using LBitmap::GetTransformationParameters function; the returned values must be passed as they are to [LBitmap:ApplyTransformationParameters function.
The shift operation is performed first, followed by the rotation and resize operations.
If you simply want to automatically straighten a bitmap, use the LBitmap::Deskew function.
To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.
This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.
Win32, x64.
For an example, refer to LBitmap::GetTransformationParameters.
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