Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.3.5
PaintOverlay(IntPtr,Int32,Rectangle,Rectangle,Rectangle,Rectangle,RasterPaintProperties) Method
See Also 
Leadtools Namespace > RasterImage Class > PaintOverlay Method : PaintOverlay(IntPtr,Int32,Rectangle,Rectangle,Rectangle,Rectangle,RasterPaintProperties) Method




hdc
The destination device context where the image will be displayed.
index
The index of the overlay used for painting. The overlay should have an image. If the overlay is embedded into an image bitplane, make sure you create an overlay image prior to calling this method. This index is zero-based.
srcRect
Rectangle which determines the portion of the image to paint.
srcClipRect
Rectangle which further clips the source image.
destRect
Rectangle which determines where the image is placed, and how it is scaled.
destClipRect
Rectangle which clips the image display.
properties
Options for the display.
Paints the overlay at the specified index. Use this method to paint overlays that are not automatically painted.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub PaintOverlay( _
   ByVal hdc As IntPtr, _
   ByVal index As Integer, _
   ByVal srcRect As Rectangle, _
   ByVal srcClipRect As Rectangle, _
   ByVal destRect As Rectangle, _
   ByVal destClipRect As Rectangle, _
   ByVal properties As RasterPaintProperties _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim hdc As IntPtr
Dim index As Integer
Dim srcRect As Rectangle
Dim srcClipRect As Rectangle
Dim destRect As Rectangle
Dim destClipRect As Rectangle
Dim properties As RasterPaintProperties
 
instance.PaintOverlay(hdc, index, srcRect, srcClipRect, destRect, destClipRect, properties)
C# 
public void PaintOverlay( 
   IntPtr hdc,
   int index,
   Rectangle srcRect,
   Rectangle srcClipRect,
   Rectangle destRect,
   Rectangle destClipRect,
   RasterPaintProperties properties
)
Managed Extensions for C++ 
public: void PaintOverlay( 
   IntPtr hdc,
   int index,
   Rectangle srcRect,
   Rectangle srcClipRect,
   Rectangle destRect,
   Rectangle destClipRect,
   RasterPaintProperties properties
) 
C++/CLI 
public:
void PaintOverlay( 
   IntPtr hdc,
   int index,
   Rectangle srcRect,
   Rectangle srcClipRect,
   Rectangle destRect,
   Rectangle destClipRect,
   RasterPaintProperties properties
) 

Parameters

hdc
The destination device context where the image will be displayed.
index
The index of the overlay used for painting. The overlay should have an image. If the overlay is embedded into an image bitplane, make sure you create an overlay image prior to calling this method. This index is zero-based.
srcRect
Rectangle which determines the portion of the image to paint.
srcClipRect
Rectangle which further clips the source image.
destRect
Rectangle which determines where the image is placed, and how it is scaled.
destClipRect
Rectangle which clips the image display.
properties
Options for the display.

Example

For an example, refer to PaintOverlay.

Remarks

This method will paint an overlay image. For more information on the paint rectangles, see Paint.

Paint will paint all the overlays that have RasterOverlayAttributes.AutoPaint set to true. The overlays are painted in ascending index order: overlay 0 is painted first, then overlay 1, etc.

Use this method to manually paint an overlay. For example, to change the order in which the overlays are painted, set the RasterOverlayAttributes.AutoPaint property of the overlay to false then call PaintOverlay directly.

To temporarily make an overlay top-most, call PaintOverlay after Paint. To permanently make an overlay top-most, change its index and give it the highest defined index.

The overlay image's 1 pixels are painted with the color set in the RasterOverlayAttributes.Color property of the overlay. The overlay image's 0 pixels are considered transparent.

For more information on the overlay attributes, including the RasterOverlayAttributes.AutoPaint property and the RasterOverlayAttributes.Color property, refer to RasterOverlayAttributes.

For more information, refer to Overlay Overview.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also