BitmapExtensionsToCursorHandle Method

KGy SOFT Drawing Libraries Help
Converts the provided bitmap to a CursorHandle, which can be passed to the System.Windows.Forms.Cursor constructor to create a new cursor.

Namespace:  KGySoft.Drawing
Assembly:  KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 5.1.0

public static CursorHandle ToCursorHandle(
	this Bitmap bitmap,
	Point cursorHotspot = null


Type: System.DrawingBitmap
The Bitmap, which should be converted to a cursor.
cursorHotspot (Optional)
Type: System.DrawingPoint
The hotspot coordinates of the cursor. This parameter is optional.
Default value: Point.Empty (top-left corner)

Return Value

Type: CursorHandle
A CursorHandle instance that can be used to create a System.Windows.Forms.Cursor instance.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

PlatformNotSupportedExceptionThis method is supported on Windows only.

Note Note
This method is supported on Windows only.
See Also