LPaint::PaintDCOverlay
#include "ltwrappr.h"
virtual L_INT LPaint::PaintDCOverlay (nIndex, uROP3=SRCCOPY)
HDC hDC; |
/* handle to the target device context */ |
L_INT nIndex; |
/* the index of the overlay bitmap used for painting */ |
LPRECT pSrc; |
/* the source rectangle */ |
LPRECT pClipSrc; |
/* the source clipping rectangle */ |
LPRECT pDst; |
/*the destination rectangle */ |
LPRECT pClipDst; |
/* the destination clipping rectangle */ |
L_UINT32 uROP3; |
/* windows ROP code for display*/ |
Paints a particular overlay. Use this function to paint overlays that are not automatically painted.
Parameter |
Description |
hDC |
Handle to a device context, such as a screen, to use as the display surface. The mapping mode of the device context must be MM_TEXT. |
pBitmap |
Pointer to the bitmap handle referencing the main bitmap. |
nIndex |
The index of the overlay used for painting. The overlay should have a bitmap. If the overlay is embedded into a bitmap bitplane, make sure you create an overlay bitmap prior to calling this function. This index is zero-based. |
pSrc |
Pointer to the Windows RECT structure that specifies the part of the bitmap to use as the display source. |
|
The coordinates in the RECT structure are relative to the main bitmap, in pBitmap coordinates, not in overlay coordinates. You can pass NULL to use the default, which matches the main bitmap. |
pClipSrc |
Pointer to the Windows RECT structure that specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source bitmap has changed. |
|
The coordinates in the RECT structure are relative to the main bitmap, in pBitmap coordinates, not in overlay coordinates. You can pass NULL to use the default, which matches the main bitmap. |
pDst |
Pointer to the Windows RECT structure that determines how the source rectangle is scaled and how the image is positioned in the device context. |
|
The coordinates in the RECT structure are relative to the device context, in pBitmap coordinates, not in overlay coordinates. There is no default for this parameter. You must specify the RECT structure. |
pClipDst |
Pointer to the Windows RECT structure that specifies the portion of the display rectangle to paint. Generally, this is used for updating changes in the display surface, such as when a user moves another window, uncovering a part of the image that had been covered up. |
|
The coordinates in the RECT structure are relative to the device context, in pBitmap coordinates, not in overlay coordinates. You can pass NULL to use the default, which matches the device context. In most cases, however, you should use the rectangle returned by the Windows WM_PAINT message. |
uFlags |
The Windows ROP code that determines how the destination rectangle is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function will paint an overlay bitmap. For more information on the paint rectangles, see LPaint::PaintDC. LPaint::PaintDC will paint all the overlays that have the AutoRepaint flag attribute set. The overlays are painted in ascending index order: overlay 0 is painted first, then overlay 1, etc.
Use this function to manually paint an overlay. For example, if you want to change the order in which the overlays are painted, you can disable their AutoRepaint flag and call LPaint::PaintDCOverlay directly.
Another situation in which you might want to call this function is when you want to temporarily make an overlay top-most. In this case, you would call LPaint::PaintDCOverlay after LPaint::PaintDC. To permanently make an overlay top-most, it is recommended you change its index and give it the highest defined index.
The overlay bitmap’s 1 pixels are painted with the overlay Color. The overlay bitmap’s 0 pixels are considered transparent.
For more information on the overlay attributes (including the AutoRepaint flag and the Color), see the Overlay Overview topic.
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. |
See Also
Functions: |
LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::SetOverlay, LBitmap::GetOverlay, Class Members, Class Members |
Topics: |
|
|
|
|
Example
/* This example assumes plBitmap contains overlays. It will make it look as if overlay 0 is topmost */
/* The example also assumes hDC and pDest have been initialized elsewhere */
LPaint MyPaint(plBitmap, hDC);
MyPaint.PaintDC(SRCCOPY);
MyPaint.PaintDCOverlay(0, SRCCOPY);
/* Now overlay 0 is topmost (it covers all the other overlays) */