#include "l_bitmap.h"
l_LTKRN_APIl_INTl_CombineBitmapWarp(pBitmapDst, ptDstArray, pBitmapSrc, ptSrc, nSrcWidth, nSrcHeight, uFlags)
Combines image data from the source bitmap (the slave) and the destination bitmap (the master), using a perspective warp.
Pointer to the bitmap handle referencing the destination bitmap. This is the master bitmap and is the bitmap that the function updates.
An array of POINT structures that contain the four points that define the warp area in the destination bitmap.
Pointer to the bitmap handle referencing the source bitmap. This is the slave bitmap, which is combined with the destination bitmap.
POINT structure that contains the point of origin of the source bitmap. This is the upper left corner. This point, along withnSrcWidth
andnSrcHeight
define the area of the source bitmap to be warped.
The width of the area in the source bitmap to be warped to the destination bitmap. This value, along withptSrc
and nSrcHeight define the area of the source bitmap to be warped.
The height of the area in the source bitmap to be warped to the destination bitmap. This value, along withptSrc
andnSrcWidth
define the area of the source bitmap to be warped.
标志显示类型of interpolation to use, if interpolation is used. Possible values are:
Value | Meaning |
---|---|
0 | No interpolation |
CBW_BILINEAR | Bilinear interpolation. This value is only valid if the bits per pixel of the image is 1-bit, 8-bit grayscale, 12-bit without a lookup table, 16-bit without a lookup table, 24, 32, 48, or 64. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer toReturn Codes. |
You can warp the entire source bitmap, or a portion of the source bitmap. To warp a portion of the source bitmap, setptSrc
,nSrcWidth
andnSrcHeight
accordingly. To warp the entire source bitmap, set the following:
ptSrc.x = 0;
ptSrc.y = 0;
nSrcWidth = pBitmapSrc.BitmapWidth;
nSrcHeight = pBitmapSrc.BitmapHeight;
The warp area in the destination bitmap is specified inptDstArray
. The polygon specified in ptDstArray must:
If either of these conditions is FALSE, this function will return an error.
The ordering of the points in ptDstArray can affect the resulting warp. For example, if the source bitmap is the following:
then ordering the points in ptDstArray as shown below results in the following warp:
while ordering the points inptDstArray
as shown below, results in the following warp:
Required DLLs and Libraries
Win32, x64, Linux.
l_INT CombineBitmapWarpExample(L_VOID)
{
l_INT nRet;
BITMAPHANDLE Master;
BITMAPHANDLE Slave;
POINT ptSrc = {0,0};
POINT aptsDest[4]= {
{50,50},
{100,75},
{100,150},
{50,100}
};
//load images as 24-bit, so we don't have to worry about palettes
nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("master.jpg")), &Master,运算符(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
if(nRet != SUCCESS)
returnnRet;
nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("cannon.jpg")), &Slave,运算符(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL);
if(nRet != SUCCESS)
returnnRet;
nRet = L_CombineBitmapWarp(&Master,
aptsDest,
&Slave,
ptSrc,
Slave.Width, Slave.Height,
CBW_BILINEAR);
if(nRet != SUCCESS)
returnnRet;
nRet = L_SaveBitmap(MAKE_IMAGE_PATH(TEXT("Result.jpg")), &Master, FILE_JPEG, 0, 2, NULL);
if(nRet != SUCCESS)
returnnRet;
if(Master.Flags.Allocated)
l_FreeBitmap(&Master);
if(Slave.Flags.Allocated)
l_FreeBitmap(&Slave);
returnSUCCESS;
}
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
188宝金博怎么下载
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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.