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



graphics
The destination Graphics object 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 graphics object.

The coordinates in the destRect object are relative to the graphics object. 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 Graphics object. You can pass Rectangle.Empty to use the default, which matches the Graphics object. In most cases, however, you should use the rectangle returned by the .NET PaintEventArgs.ClipRectangle or Windows WM_PAINT message.

buffer
Pointer to the unmanaged memory buffer that contains the image data to paint
row
The first row to paint. The painted portion of any row may be limited by the rectangle parameters.
count

The number of rows to paint. The painted portion of any row may be limited by the rectangle parameters.

If the image data in buffer is compressed 1-bit data, you can specify the number of lines as a negative value (-lines), as explained in Speeding Up 1-Bit Documents.

properties
Options for the display.
Paints image data from an unmanaged memory buffer into a Graphics object.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub PaintBuffer( _
   ByVal graphics As Graphics, _
   ByVal srcRect As Rectangle, _
   ByVal srcClipRect As Rectangle, _
   ByVal destRect As Rectangle, _
   ByVal destClipRect As Rectangle, _
   ByVal buffer As IntPtr, _
   ByVal row As Integer, _
   ByVal count As Integer, _
   ByVal properties As RasterPaintProperties _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim graphics As Graphics
Dim srcRect As Rectangle
Dim srcClipRect As Rectangle
Dim destRect As Rectangle
Dim destClipRect As Rectangle
Dim buffer As IntPtr
Dim row As Integer
Dim count As Integer
Dim properties As RasterPaintProperties
 
instance.PaintBuffer(graphics, srcRect, srcClipRect, destRect, destClipRect, buffer, row, count, properties)
C# 
public void PaintBuffer( 
   Graphics graphics,
   Rectangle srcRect,
   Rectangle srcClipRect,
   Rectangle destRect,
   Rectangle destClipRect,
   IntPtr buffer,
   int row,
   int count,
   RasterPaintProperties properties
)
C++/CLI 
public:
void PaintBuffer( 
   Graphics graphics,
   Rectangle srcRect,
   Rectangle srcClipRect,
   Rectangle destRect,
   Rectangle destClipRect,
   IntPtr buffer,
   int row,
   int count,
   RasterPaintProperties properties
) 

Parameters

graphics
The destination Graphics object 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 graphics object.

The coordinates in the destRect object are relative to the graphics object. 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 Graphics object. You can pass Rectangle.Empty to use the default, which matches the Graphics object. In most cases, however, you should use the rectangle returned by the .NET PaintEventArgs.ClipRectangle or Windows WM_PAINT message.

buffer
Pointer to the unmanaged memory buffer that contains the image data to paint
row
The first row to paint. The painted portion of any row may be limited by the rectangle parameters.
count

The number of rows to paint. The painted portion of any row may be limited by the rectangle parameters.

If the image data in buffer is compressed 1-bit data, you can specify the number of lines as a negative value (-lines), as explained in Speeding Up 1-Bit Documents.

properties
Options for the display.

Example

For an example, refer to PaintBuffer.

Remarks

If the graphics object has fewer colors than the image, this method dithers the output to that display surface without affecting the actual image data.

If destRect is larger or smaller than the image's actual dimensions, then the image will be scaled to fit destRect.

If the image data in buffer is compressed 1-bit data, you can specify the number of lines as a negative value (-row), as explained in Speeding Up 1-Bit Documents.

The following properties are used from this RasterImage:

Except for the buffer specifications, this method uses source and destination rectangles the same as Paint. For a complete explanation, refer to Paint.

You can call PaintBuffer from a callback procedure to paint an image while it is being loaded.

For more information, refer to Changing Image Coordinates.

For more information, refer to Handling Palette Changes.

Requirements

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

See Also