IDeviceContext.GetHdc 方法
定义
返回 Windows 设备上下文的图柄。Returns the handle to a Windows device context.
public:
IntPtr GetHdc();
public IntPtr GetHdc ();
abstract member GetHdc : unit -> nativeint
Public Function GetHdc () As IntPtr
返回
表示设备上下文的图柄的 IntPtr。An IntPtr representing the handle of a device context.
注解
GetHdc 和 ReleaseHdc 是两种方法,可让你获取和释放基于 Windows 的设备的句柄。GetHdc and ReleaseHdc are two methods that allow you to get and release the handle for a Windows-based device. GetHdc使用完 Windows 句柄后,应始终在调用 ReleaseHdc 时调用。You should always follow a call to GetHdc with a call to ReleaseHdc when you are finished with the Windows handle.
GetHdc 不是为了获取使用 Windows GDI 方法(如或)创建的句柄 CreateDC CreateCompatibleDC 。GetHdc is not designed to obtain handles created using Windows GDI methods such as CreateDC or CreateCompatibleDC.