ID2D1DeviceContext::DrawBitmap method

Draws a bitmap to the render target.

Syntax

void DrawBitmap(
  ID2D1Bitmap               *bitmap,
  const D2D1_RECT_F &       destinationRectangle,
  FLOAT                     opacity,
  D2D1_INTERPOLATION_MODE   interpolationMode,
  const D2D1_RECT_F &       sourceRectangle,
  const D2D1_MATRIX_4X4_F & perspectiveTransform
);

Parameters

bitmap

Type: ID2D1Bitmap*

The bitmap to draw.

destinationRectangle

Type: D2D1_RECT_F*

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

opacity

Type: FLOAT

The opacity of the bitmap.

interpolationMode

Type: D2D1_INTERPOLATION_MODE

The interpolation mode to use.

sourceRectangle

Type: const D2D1_RECT_F

An optional source rectangle.

perspectiveTransform

Type: const D2D1_MATRIX_4X4_F

An optional perspective transform.

Return Value

This method does not return a value.

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 sourceRectangle 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.

Requirements

   
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1_1.h
DLL D2d1.dll

See Also

ID2D1DeviceContext