Graphics::FromHDC(HDC,HANDLE) method (gdiplusgraphics.h)
The Graphics::FromHDC method creates a Graphics object that is associated with a specified device context and a specified device.
Syntax
Graphics * FromHDC(
[in] HDC hdc,
[in] HANDLE hdevice
);
Parameters
[in] hdc
Type: HDD
Handle to the device context that is associated with the new Graphics object.
[in] hdevice
Type: HANDLE
Handle to a device that is associated with the new Graphics object.
Return value
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
Requirement | Value |
---|---|
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for