L_ShearBitmap

#include "l_bitmap.h"

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

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

L_INT nAngle;

/* angle of slant */

L_BOOL fHorizontal;

/* TRUE for horizontal, FALSE for vertical */

COLORREF crFill;

/* COLORREF value for the fill color */

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

Parameter

Description

pBitmap

Pointer to the bitmap handle referencing the bitmap to shear.

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).

fHorizontal

TRUE for horizontal shear, or FALSE for vertical shear.

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

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

You specify an angle of slant, horizontal or vertical shear, and the fill color for the created space. The following is a horizontal example:

image\shear.gif

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

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_RotateBitmap, L_RotateBitmapFine, L_FlipBitmap, L_ReverseBitmap, L_DlgShear

Topics:

Raster Image Functions: Doing Geometric Transformations

 

Resizing Considerations

 

Using Color Values in LEADTOOLS

Example

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

BITMAPHANDLE LeadBitmap;   /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap
 (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Shear the bitmap 15 degrees vertically, filling extra space with blue */
L_ShearBitmap
(&LeadBitmap, -1500, FALSE, RGB(0, 0, 255) );