Graphics::DrawImage(Image,RectF,Matrix,Effect,ImageAttributes,Unit) method (gdiplusgraphics.h)

The method draws a portion of an image after applying a specified effect.

Syntax

Status DrawImage(
  Image           *image,
  RectF           *sourceRect,
  Matrix          *xForm,
  Effect          *effect,
  ImageAttributes *imageAttributes,
  Unit            srcUnit
);

Parameters

image

Type: Image*

Pointer to an Image object that specifies the image to be drawn.

sourceRect

Type: RectF*

Pointer to a RectF object that specifies the portion of the image to be drawn.

xForm

Type: Matrix*

Pointer to a Matrix object that specifies the parallelogram in which the image portion is rendered. The destination parallelogram is calculated by applying the affine transformation stored in the matrix to the source rectangle.

effect

Type: Effect*

Pointer to a instance of a descendant of the Effect class. The descendant specifies an effect or adjustment (for example, a change in contrast) that is applied to the image before rendering. The image is not permanently altered by the effect.

imageAttributes

Type: ImageAttributes*

Pointer to an ImageAttributes object that specifies color adjustments to be applied when the image is rendered. Can be NULL.

srcUnit

Type: Unit*

Element of the Unit enumeration that specifies the unit of measure for the source rectangle.

Return value

Type: Status

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Requirements

   
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusgraphics.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Drawing, Positioning, and Cloning Images

Graphics

Image

Loading and Displaying Bitmaps