Class GdiExtensions
Some extensions for GDI stuff
Inheritance
System.Object
GdiExtensions
Namespace: Dapplo.Windows.Gdi32
Assembly: Dapplo.Windows.Gdi32.dll
Syntax
public static class GdiExtensions : object
Methods
| Improve this Doc View SourceAreRectangleCornersVisisble(Region, Rectangle)
Check if all the corners of the rectangle are visible in the specified region. Not a perfect check, but this currently a workaround for checking if a window is completely visible
Declaration
public static bool AreRectangleCornersVisisble(this Region region, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
Region | region | |
Rectangle | rectangle |
Returns
Type | Description |
---|---|
System.Boolean |
GetSafeDeviceContext(Graphics)
Get a SafeHandle for the GetHdc, so one can use using to automatically cleanup the devicecontext
Declaration
public static SafeDeviceContextHandle GetSafeDeviceContext(this Graphics graphics)
Parameters
Type | Name | Description |
---|---|---|
Graphics | graphics | Graphics |
Returns
Type | Description |
---|---|
SafeDeviceContextHandle | SafeDeviceContextHandle |
GetSafeHBitmapHandle(Bitmap)
Get a SafeHBitmapHandle so one can use using to automatically cleanup the HBitmap
Declaration
public static SafeHBitmapHandle GetSafeHBitmapHandle(this Bitmap bitmap)
Parameters
Type | Name | Description |
---|---|---|
Bitmap | bitmap | Bitmap |
Returns
Type | Description |
---|---|
SafeHBitmapHandle | SafeHBitmapHandle |
GetSafeIconHandle(Bitmap)
Get a SafeIconHandle so one can use using to automatically cleanup the HIcon
Declaration
public static SafeIconHandle GetSafeIconHandle(this Bitmap bitmap)
Parameters
Type | Name | Description |
---|---|---|
Bitmap | bitmap | Bitmap |
Returns
Type | Description |
---|---|
SafeIconHandle | SafeIconHandle |