GraphicsExtensionsToBitmap Method

KGy SOFT Drawing Libraries Help
Copies the Graphics object provided in graphics parameter to a Bitmap instance.

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

public static Bitmap ToBitmap(
	this Graphics graphics,
	bool visibleClipOnly
)

Parameters

graphics
Type: System.DrawingGraphics
The Graphics instance to be converted.
visibleClipOnly
Type: SystemBoolean
When , the result will contain only the area represented by VisibleClipBounds property. When , the result will contain the image of the whole container source (when a container object is found), where the visible clip bounds can be identified by VisibleClipBounds in pixels.

Return Value

Type: Bitmap
A Bitmap object that contains the image content of the source Graphics object, or , when the required area of graphics is empty.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Graphics. 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).
Exceptions

ExceptionCondition
PlatformNotSupportedExceptionThis method is supported on Windows only.
Remarks

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

Reference