[]
Holds a Graphics object together with (printer) device or bitmap that was used to create it, if any. The point is to dispose the device or bitmap together with the graphics when it is no longer needed (i.e. to avoid resource leaks).
public class GraphicsHolder : Object, IDisposable
Public Class GraphicsHolder
Inherits Object
Implements IDisposable
| Name | Description |
|---|---|
| Empty | An empty graphics holder instance. |
| Name | Description |
|---|---|
| DpiX | Gets the horizontal resolution of graphics held by the current instance. |
| DpiY | Gets the vertical resolution of graphics held by the current instance. |
| Graphics | Gets the graphics object held by the current instance. |
| Name | Description |
|---|---|
| Dispose() | Disposes the current graphics holder. |
| Dispose(bool) | Disposes the current graphics holder. |
| Finalize() | |
| FromBitmap() | Creates a graphics holder from a bitmap. The graphics and the bitmap are released when the holder is disposed. This should never fail. |
| FromDC(IntPtr) | Creates a graphics holder from a device context. When the holder is disposed, both graphics and the device context are released (DeleteDC is called on the device context). |
| FromDevice(MeasurementDevice, string, out MeasurementDevice, out string) | Creates a graphics holder from a printer or screen device contexts, depending on passing parameters.
When the holder is disposed, both graphics and the device context are released (DeleteDC is called on the device context).
If |
| FromGraphics(Graphics) | Creates a graphics holder from a graphics instance. When the holder is disposed, the graphics is left alone (i.e. NOT disposed). |
| FromScreen() | Creates a graphics holder from screen. If that fails (e.g. on Azure), the graphics is created from a bitmap. When the holder is disposed, both graphics and the bitmap are released. |