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



hdc
The destination Windows device context handle where the image data will be displayed.
srcRect

A Rectangle object that specifies the part of the image to use as the display source.

The coordinates in the srcRect rectangle are relative to the image. You can pass Rectangle.Empty to use the default, which matches the image.

srcClipRect

A Rectangle object specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source image has changed.

The coordinates in the srcClipRect rectangle are relative to the image. You can pass Rectangle.Empty to use the default, which matches the image

destRect

A Rectangle object that determines how the source rectangle is scaled and how the image is positioned in the destination hdc handle.

The coordinates in the destRect object are relative to the hdc handle. There is no default for this parameter. You must specify the Rectangle object.

destClipRect

A Rectangle object 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 destClipRect are relative to the device context handle. You can pass Rectangle.Empty to use the default, which matches the device context handle. In most cases, however, you should use the rectangle returned by the .NET PaintEventArgs.ClipRectangle or Windows WM_PAINT message.

properties
Options for the display.
Paints the image region to a Windows device context handle.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub PaintRegion( _
   ByVal hdc As IntPtr, _
   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 srcRect As Rectangle
Dim srcClipRect As Rectangle
Dim destRect As Rectangle
Dim destClipRect As Rectangle
Dim properties As RasterPaintProperties
 
instance.PaintRegion(hdc, srcRect, srcClipRect, destRect, destClipRect, properties)
C# 
public void PaintRegion( 
   IntPtr hdc,
   Rectangle srcRect,
   Rectangle srcClipRect,
   Rectangle destRect,
   Rectangle destClipRect,
   RasterPaintProperties properties
)
C++/CLI 
public:
void PaintRegion( 
   IntPtr hdc,
   Rectangle srcRect,
   Rectangle srcClipRect,
   Rectangle destRect,
   Rectangle destClipRect,
   RasterPaintProperties properties
) 

Parameters

hdc
The destination Windows device context handle where the image data will be displayed.
srcRect

A Rectangle object that specifies the part of the image to use as the display source.

The coordinates in the srcRect rectangle are relative to the image. You can pass Rectangle.Empty to use the default, which matches the image.

srcClipRect

A Rectangle object specifies the portion of the display source to paint. Generally, this is used for updating the display when part of the source image has changed.

The coordinates in the srcClipRect rectangle are relative to the image. You can pass Rectangle.Empty to use the default, which matches the image

destRect

A Rectangle object that determines how the source rectangle is scaled and how the image is positioned in the destination hdc handle.

The coordinates in the destRect object are relative to the hdc handle. There is no default for this parameter. You must specify the Rectangle object.

destClipRect

A Rectangle object 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 destClipRect are relative to the device context handle. You can pass Rectangle.Empty to use the default, which matches the device context handle. In most cases, however, you should use the rectangle returned by the .NET PaintEventArgs.ClipRectangle or Windows WM_PAINT message.

properties
Options for the display.

Example

For an example, refer to PaintRegion.

Remarks

This method works the same as Paint, except that only the image region is painted.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also