IDeviceContext IDeviceContext IDeviceContext IDeviceContext Interface


定义用于获取并释放 Windows 设备上下文的现有图柄的方法。Defines methods for obtaining and releasing an existing handle to a Windows device context.

public interface class IDeviceContext : IDisposable
public interface IDeviceContext : IDisposable
type IDeviceContext = interface
    interface IDisposable
Public Interface IDeviceContext
Implements IDisposable


设备上下文定义图形对象, 以便在基于 Windows 的设备上进行绘制。A device context defines the graphics object for drawing on a Windows-based device. IDeviceContextGraphics是实现接口的类的一个示例。An example of a class that implements the IDeviceContext interface is the Graphics class.


Dispose() Dispose() Dispose() Dispose()

执行与释放或重置非托管资源关联的应用程序定义的任务。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from IDisposable)
GetHdc() GetHdc() GetHdc() GetHdc()

返回 Windows 设备上下文的图柄。Returns the handle to a Windows device context.

ReleaseHdc() ReleaseHdc() ReleaseHdc() ReleaseHdc()

释放 Windows 设备上下文的图柄。Releases the handle of a Windows device context.