Retrieves the rectangles used when painting the class objects bitmap.
#include "ltwrappr.h"
virtual L_VOID LBitmapBase::GetRects(prcSrc, prcClipSrc, prcDst, prcClipDst)
Optional pointer to a RECT windows structure, that will receive the bitmap source rectangle.
Optional pointer to a RECT windows structure, that will receive the bitmap source clip rectangle.
Optional pointer to a RECT windows structure, that will receive the bitmap destination rectangle.
Optional pointer to a RECT windows structure, that will receive the bitmap destination clip rectangle.
None.
Use this function to retrieve the rectangles used for the class object when painting the bitmap.
NOTE: These illustrations are for a bitmap with a TOP_LEFT view perspective. For an explanation of bitmap coordinates and view perspectives, refer to Accounting for View Perspective.
In addition, you can specify a clipping area within either rectangle to limit the area to be painted. For the destination rectangle, a clipping area is commonly specified to repaint part of the image that was temporarily covered up. For a source rectangle, you can use a clipping area to update the display when only part of the image in the source rectangle has changed.
The following illustration shows how specifying a source clipping area affects the display. Text has been added to the source bitmap (using the bitmap as a display surface), and the source clipping area specifies the area to be repainted.
You can specify the various rectangles in any way that meets your needs. Coordinates can have negative values and they can extend beyond the bounds of the bitmap or the device context. In fact, it is common for the display rectangle to be bigger than the device context, where scroll bars are used to see different parts of the image.
In simple cases, you can use this function as follows:
Win32, x64.
L_INT LBitmapBase__GetRectsExample()
{
L_INT nRet;
LBitmapBase MyBitmap;
RECT DstRct,rcTemp;
nRet =MyBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")),24);
if(nRet !=SUCCESS)
return nRet;
rcTemp.left=10;
rcTemp.top=10;
rcTemp.right=300;
rcTemp.bottom=300;
nRet =MyBitmap.SetSrcRect(&rcTemp);
if(nRet !=SUCCESS)
return nRet;
rcTemp.left=20;
rcTemp.top=20;
rcTemp.right=200;
rcTemp.bottom=200;
nRet =MyBitmap.SetClipSrcRect(&rcTemp);
if(nRet !=SUCCESS)
return nRet;
rcTemp.left=0;
rcTemp.top=0;
rcTemp.right=MyBitmap.GetWidth();
rcTemp.bottom=MyBitmap.GetHeight();
nRet =MyBitmap.SetDstRect(&rcTemp);
if(nRet !=SUCCESS)
return nRet;
rcTemp.left=20;
rcTemp.top=20;
rcTemp.right=MyBitmap.GetWidth()-20;
rcTemp.bottom=MyBitmap.GetHeight()-30;
nRet = MyBitmap.SetClipDstRect(&rcTemp);
if(nRet !=SUCCESS)
return nRet;
MyBitmap.GetRects(0,0,&DstRct,0);
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