Releases a device context handle obtained by a previous call to the GetHdc method of this Graphics.
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public void 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.
for access to unmanaged code. Related enumeration: UnmanagedCode.