L_ShearBitmap

#include "l_bitmap.h"

L_LTKRN_API L_INT L_ShearBitmap(pBitmap, nAngle, fHorizontal, crFill)

Moves the corners of a bitmap in the fashion of a parallelogram.

Parameters

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle referencing the bitmap to shear.

L_INT nAngle

The angle of slant. Positive values are for clockwise angles; negative values are for counterclockwise angles. The angle is expressed in hundredths of degrees, with a limit of 4500 (45 degrees).

L_BOOL fHorizontal

TRUE for horizontal shear, or FALSE for vertical shear.

L_COLORREF crFill

The COLORREF value that specifies the fill color. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

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.

You specify an angle of slant, horizontal or vertical shear, and the fill color for the created space.

For an example, click here

The angle is expressed in hundredths of degrees, with a limit of 4500 (45 degrees).

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

For complete sample code, refer to the CHILD.C module of the DEMO example.

L_INT ShearBitmapExample(L_VOID) 
{ 
   L_INT nRet; 
   BITMAPHANDLE LeadBitmap;   /* Bitmap handle to hold the loaded image. */ 
 
   /* Load the bitmap, keeping the bits per pixel of the file */ 
   nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("IMAGE1.CMP")), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Shear the bitmap 15 degrees vertically, filling extra space with blue */ 
   nRet = L_ShearBitmap(&LeadBitmap, -1500, FALSE, RGB(0, 0, 255) ); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_SaveBitmap(MAKE_IMAGE_PATH(TEXT("Result.BMP")), &LeadBitmap, FILE_BMP, 24, 0, NULL); 
   if(nRet != SUCCESS) 
      return nRet; 
   if(LeadBitmap.Flags.Allocated) 
      L_FreeBitmap(&LeadBitmap);  
 
   return SUCCESS; 
} 

Help Version 20.0.2019.10.13
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help