L_OffsetBitmapRgn
#include "l_bitmap.h"
L_INT EXT_FUNCTION L_OffsetBitmapRgn(pBitmap, nRowOffset, nColOffset)
pBITMAPHANDLE pBitmap; |
/* pointer to the bitmap handle */ |
L_INT nRowOffset; |
/* number of rows to move the region */ |
L_INT nColOffset; |
/* number of columns to move the region */ |
Moves the bitmap region by the specified number of rows and columns. The move does not affect the pixels in the region.
Parameter |
Description |
pBitmap |
Pointer to the bitmap handle referencing the bitmap that has the region. |
nRowOffset |
The number of rows to move the region. |
nColOffset |
The number of columns to move the region. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function uses bitmap coordinates to specify the region. Therefore, you must account for the view perspective of the bitmap. For more information, refer to Accounting for View Perspective.
Required DLLs and Libraries
LTDIS 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: |
|
Topics: |
|
|
|
|
Example
For complete sample code, refer to the DRAW example.
/* This example moves the bitmap region down and to the right */
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
void TestFunction ( HWND hWnd )
{
L_INT nRowOffset; /* Movement on the Y axis */
L_INT nColOffset; /* Movement on the X axis */
L_INT x1,x2;
L_INT y1,y2;
/* We are going to move the region down and to the right */
/* by 1/4 of the display dimensions. */
/* First, get the display width and height */
nRowOffset = BITMAPHEIGHT(&LeadBitmap) / 4;
nColOffset = BITMAPWIDTH(&LeadBitmap) / 4;
/* Now, account for ViewPerspective */
x1 = 0;
y1 = 0;
x2 = nColOffset;
y2 = nRowOffset;
L_PointToBitmap ( &LeadBitmap, TOP_LEFT, &x1, &y1 );
L_PointToBitmap ( &LeadBitmap, TOP_LEFT, &x2, &y2 );
nColOffset = x2-x1;
nRowOffset = y2-y1;
/* Move the region */
L_OffsetBitmapRgn(&LeadBitmap, nRowOffset, nColOffset);
}