Compartir a través de


Graphics.Graphics(Image*) constructor

Applies to: desktop apps only

Creates a Graphics::Graphics object that is associated with an Image object.

Syntax

Graphics(
  [in]  Image* image
);

Parameters

  • image [in]
    Type: Image*

    Pointer to an Image object that will be associated with the new Graphics::Graphics object.

Remarks

This constructor fails if the Image object is based on a metafile that was opened for reading. The Image::Image(file) and Metafile::Metafile(file) constructors open a metafile for reading. To open a metafile for recording, use a Metafile constructor that receives a device context handle.

This constructor also fails if the image uses one of the following pixel formats:

  • PixelFormatUndefined
  • PixelFormatDontCare
  • PixelFormat1bppIndexed
  • PixelFormat4bppIndexed
  • PixelFormat8bppIndexed
  • PixelFormat16bppGrayScale
  • PixelFormat16bppARGB1555

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

Graphics Constructors

Image

Getting Started

Changes in the Programming Model

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012