ID2D1CommandSink::DrawBitmap method

Draws a bitmap to the render target.

Syntax


void DrawBitmap(
  [in]            ID2D1Bitmap *bitmap,
  [in, optional]  D2D1_RECT_F destinationRectangle,
  FLOAT opacity,
  D2D1_INTERPOLATION_MODE interpolationMode,
  [in, optional]  const D2D1_RECT_F sourceRectangle,
  [in, optional]  const D2D1_MATRIX_4X4_F perspectiveTransform
);

Parameters

bitmap [in]

Type: ID2D1Bitmap*

The bitmap to draw.

destinationRectangle [in, optional]

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 [in, optional]

Type: const D2D1_RECT_F

An optional source rectangle.

perspectiveTransform [in, optional]

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 you specify NULL, then the destination rectangle is (left=0, top=0, right = width(sourceRectangle), bottom = height(sourceRectangle).

The sourceRectangle defines the sub-rectangle of the source bitmap (in DIPs). DrawBitmap clips this rectangle to the size of the source bitmap, so it's impossible to sample outside of the bitmap. If you specify NULL, then the source rectangle is taken to be the size of the source bitmap.

The perspectiveTransform is specified in addition to the transform on device context.

Requirements

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1_1.h

DLL

D2d1.dll

See also

ID2D1CommandSink

 

 

Community Additions

ADD
Show:
© 2014 Microsoft