ID2D1RenderTarget::DrawBitmap(ID2D1Bitmap*,constD2D1_RECT_F&,FLOAT,D2D1_BITMAP_INTERPOLATION_MODE,constD2D1_RECT_F&) method (d2d1.h)

Draws the specified bitmap after scaling it to the size of the specified rectangle.

Syntax

void DrawBitmap(
  [in]  ID2D1Bitmap                    *bitmap,
  [ref] const D2D1_RECT_F &            destinationRectangle,
        FLOAT                          opacity,
        D2D1_BITMAP_INTERPOLATION_MODE interpolationMode,
  [ref] const D2D1_RECT_F &            sourceRectangle
);

Parameters

[in] bitmap

Type: ID2D1Bitmap*

The bitmap to render.

[ref] destinationRectangle

Type: const D2D1_RECT_F

The size and position, in device-independent pixels in the render target's coordinate space, of the area to which the bitmap is drawn. If the rectangle is not well-ordered, nothing is drawn, but the render target does not enter an error state.

opacity

Type: FLOAT

A value between 0.0f and 1.0f, inclusive, that specifies an opacity value to apply to the bitmap; this value is multiplied against the alpha values of the bitmap's contents.

interpolationMode

Type: D2D1_BITMAP_INTERPOLATION_MODE

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

[ref] sourceRectangle

Type: const D2D1_RECT_F

The size and position, in device-independent pixels in the bitmap's coordinate space, of the area within the bitmap to draw.

Return value

None

Remarks

This method doesn't return an error code if it fails. To determine whether a drawing operation (such as DrawBitmap) failed, check the result returned by the ID2D1RenderTarget::EndDraw or ID2D1RenderTarget::Flush methods.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1.h
Library D2d1.lib
DLL D2d1.dll

See also

ID2D1RenderTarget