#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.
Pointer to the bitmap handle referencing the bitmap that has the region.
The number of rows to move the region.
The number of columns to move the region.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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
Win32, x64, Linux.
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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document