Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.11.1
LEADTOOLS Raster Imaging C DLL Help

L_OffsetBitmapRgn

Show in webframe

#include "l_bitmap.h"

L_LTDIS_API L_INT 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

Win32, x64, Linux.

See Also

Functions:

L_GetBitmapRgnBounds

Topics:

Raster Image Functions: Creating and Using a Region

 

Raster Image Functions: Region Processing

 

Defining and Using a Bitmap Region

Example

For complete sample code, refer to the DRAW example.

/* This example moves the bitmap region down and to the right */
 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;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.