Graphics.FromHDC(HDD, HANDLE) method

Applies to: desktop apps only

The Graphics::FromHDC method creates a Graphics object that is associated with a specified device context and a specified device.

Syntax

static Graphics* FromHDC(
  [in]  HDD hdc,
  [in]  HANDLE hDevice
);

Parameters

  • hdc [in]
    Type: HDD

    Handle to the device context that is associated with the new Graphics object.

  • hDevice [in]
    Type: HANDLE

    Handle to a device that is associated with the new Graphics object.

Return value

Type:

Type: Graphics*****

This method returns a pointer to the new Graphics object.

Remarks

When you use this method to create a Graphics object, make sure that the Graphics object is deleted before the device context is released.

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::GetHDC

Graphics Constructors

FromHDC Methods

Graphics::FromHWND

Graphics::FromImage

Optimizing Printing by Providing a Printer Handle

Changes in the Programming Model

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012