Graphics.DrawImage(Image*, const PointF) method

Applies to: desktop apps only

The Graphics::DrawImage method draws an image.

Syntax

Status DrawImage(
  [in]       Image *image,
  [in, ref]  const PointF &point
);

Parameters

  • image [in]
    Type: Image*

    Pointer to an Image object that specifies the source image.

  • point [in, ref]
    Type: const PointF

    Reference to a PointF object that specifies the coordinates of the upper-left corner of the destination position at which to draw the image.

Return value

Type:

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.

Examples

The following example draws an image. The image is drawn with the upper-left corner at the coordinate specified by the point parameter.

VOID Example_DrawImage8(HDC hdc)

{

   Graphics graphics(hdc);

   // Create an Image object.
   Image image(L"climber.jpg");

   // Draw the image.
   graphics.DrawImage(&image, PointF(0.0f, 0.0f));
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics

Image

PointF

Loading and Displaying Bitmaps

Drawing, Positioning, and Cloning Images

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012