L_OffsetBitmapRgn

#include "l_bitmap.h"

L_LTDIS_API L_INT L_OffsetBitmapRgn(pBitmap, nRowOffset, nColOffset)

Moves the bitmap region by the specified number of rows and columns. The move does not affect the pixels in the region.

Parameters

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle referencing the bitmap that has the region.

L_INT nRowOffset

The number of rows to move the region.

L_INT nColOffset

The number of columns to move the region.

Returns

Value Meaning
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

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

This example moves the bitmap region down and to the right. For complete sample code, refer to the DRAW example.

L_INT OffsetBitmapRgnExample(pBITMAPHANDLE pBitmap) 
{ 
   L_INT nRet; 
   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(pBitmap) / 4; 
   nColOffset = BITMAPWIDTH(pBitmap) / 4; 
   /* Now, account for ViewPerspective */ 
   x1 = 0; 
   y1 = 0; 
   x2 = nColOffset; 
   y2 = nRowOffset; 
   nRet = L_PointToBitmap ( pBitmap, TOP_LEFT, &x1, &y1 ); 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = L_PointToBitmap ( pBitmap, TOP_LEFT, &x2, &y2 ); 
   if(nRet != SUCCESS) 
      return nRet; 
   nColOffset = x2-x1; 
   nRowOffset = y2-y1; 
   /* Move the region */ 
   nRet = L_OffsetBitmapRgn(pBitmap, nRowOffset, nColOffset); 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 

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

LEADTOOLS Raster Imaging C API Help