Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID2D1DeviceContext::DrawImage method

Draws an image to the device context.

Syntax


void DrawImage(
  [in]            ID2D1Image *image,
  [in, optional]  const D2D1_POINT_2F *targetOffset,
  [in, optional]  const D2D1_RECT_F *imageRectangle,
  D2D1_INTERPOLATION_MODE interpolationMode,
  D2D1_COMPOSITE_MODE compositeMode
);

Parameters

image [in]

Type: ID2D1Image*

The image to be drawn to the device context.

targetOffset [in, optional]

Type: const D2D1_POINT_2F*

The offset in the destination space that the image will be rendered to. The entire logical extent of the image will be rendered to the corresponding destination. If not specified, the destination origin will be (0, 0). The top-left corner of the image will be mapped to the target offset. This will not necessarily be the origin. This default value is NULL.

imageRectangle [in, optional]

Type: const D2D1_RECT_F*

The corresponding rectangle in the image space will be mapped to the given origins when processing the image. This default value is NULL.

interpolationMode

Type: D2D1_INTERPOLATION_MODE

The interpolation mode that will be used to scale the image if necessary. The default value is D2D1_IMAGE_INTERPOLATION_BILINEAR.

compositeMode

Type: D2D1_COMPOSITE_MODE

The composite mode that will be applied to the limits of the currently selected clip. The default value is D2D1_COMPOSITE_MODE_DEFAULT

Return value

This method does not return a value.

Remarks

If interpolationMode is D2D1_INTERPOLATION_MODE_HIGH_QUALITY, different scalers will be used depending on the scale factor implied by the world transform.

Any invalid rectangles accumulated on any effect that is drawn by this call will be discarded regardless of which portion of the image rectangle is drawn.

If compositeMode is D2D1_COMPOSITE_MODE_DEFAULT, DrawImage will use the currently selected primitive blend specified by ID2D1DeviceContext::SetPrimitiveBlend. If compositeMode is not D2D1_COMPOSITE_MODE_DEFAULT, the image will be extended to transparent up to the current axis-aligned clip.

If there is an image rectangle and a world transform, this is equivalent to inserting a clip effect to represent the image rectangle and a 2D affine transform to take into account the world transform.

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

ID2D1DeviceContext
ID2D1Image
ID2D1Effect
ID2D1Bitmap
ID2D1Bitmap1

 

 

Community Additions

Show:
© 2014 Microsoft