Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Graphics.ReleaseHdc Method

Releases a device context handle obtained by a previous call to the GetHdc method of this Graphics.

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

'Declaration
<SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags := SecurityPermissionFlag.UnmanagedCode)> _
Public Sub ReleaseHdc

Implements

IDeviceContext.ReleaseHdc

GetHdc and ReleaseHdc are two methods that allow you to get and release the handle for a Windows device. You should always follow a call to GetHdc with a call to ReleaseHdc when you are finished with the Windows handle.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Show:
© 2015 Microsoft