Table of Contents

Method DrawBitmap

Namespace
PaintDotNet.Direct2D1
Assembly
PaintDotNet.Windows.dll

DrawBitmap(IDeviceBitmap, in RectFloat?, float, InterpolationMode, in RectFloat?, in Matrix4x4Float?)

Draws a bitmap to the render target.

void DrawBitmap(IDeviceBitmap bitmap, in RectFloat? dstRect = null, float opacity = 1, InterpolationMode interpolationMode = InterpolationMode.Linear, in RectFloat? srcRect = null, in Matrix4x4Float? perspectiveTransform = null)

Parameters

bitmap IDeviceBitmap

The bitmap to draw.

dstRect RectFloat?

The destination rectangle. The default is the size of the bitmap and the location is the upper left corner of the render target.

opacity float

The opacity of the bitmap.

interpolationMode InterpolationMode

The interpolation mode to use if the bitmap is scaled or rotated by the drawing operation.

srcRect RectFloat?

An optional source rectangle.

perspectiveTransform Matrix4x4Float?

An optional perspective transform.

Remarks

The destinationRectangle parameter defines the rectangle in the target where the bitmap will appear (in device-independent pixels (DIPs)). This is affected by the currently set transform and the perspective transform, if set. If null is specified, then the destination rectangle is (left=0, top=0, right = width(sourceRectangle), bottom = height(sourceRectangle)).
The srcRect parameter defines the sub-rectangle of the source bitmap (in DIPs). DrawBitmap will clip this rectangle to the size of the source bitmap, thus making it impossible to sample outside of the bitmap. If null is specified, then the source rectangle is taken to be the size of the source bitmap.
If you specify perspectiveTransform it is applied to the rect in addition to the transform set on the render target.