L_LTIMGSFX_API L_INT L_PerspectiveBitmap(pBitmap, pPoints, crBkgColor, uFlags)
Gives a bitmap a 3-D effect, as if it exists on a flat plane and has been skewed into a different shape.
Pointer to the bitmap handle referencing the bitmap to be changed.
Pointer to an array of points that determines the new locations of the image corners. It should contain four points; points at indices 0, 1, 2 and 3 determine the new locations of left-top, right-top, left-bottom and right-bottom image corners respectively.
Flag that indicates how to create the background. Possible values are:
|PERSPECTIVE_IMAGE||[0x0001] Use the same image as the background.|
|PERSPECTIVE_COLOR||[0x0002] Fill the back ground with
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
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.
The new locations for the image corners should keep the relative relation between corners. For example, the point at index 1 should be to the right of point at index 0 and above the point at index 3. Also, the point at index 2 should be to the left of the point at index 3 and below the point at index 0 and so on. All new locations should remain inside the image.
To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.
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 in the Document and Medical Imaging toolkits.
If the bitmap has a region, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.
This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.
Required DLLs and Libraries
The following example loads a bitmap, and applies the 3D perspective effect
POINT pNewLocations ;
/* Load the bitmap, keeping the bits per pixel of the file */
nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("Sample1.CMP")), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/*Apply the filter*/
nRet = L_PerspectiveBitmap(&LeadBitmap, pNewLocations,RGB(255,255,255), PERSPECTIVE_IMAGE);
nRet = L_SaveBitmap(MAKE_IMAGE_PATH(TEXT("Result.BMP")), &LeadBitmap, FILE_BMP, 24, 0, NULL);
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries