GraphicsExtensionsToBitmap Method
Copies the
Graphics object specified in the
graphics parameter to a
Bitmap instance.
Namespace: KGySoft.DrawingAssembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 8.1.0
public static Bitmap? ToBitmap(
this Graphics graphics,
bool visibleClipOnly
)
<ExtensionAttribute>
Public Shared Function ToBitmap (
graphics As Graphics,
visibleClipOnly As Boolean
) As Bitmap
public:
[ExtensionAttribute]
static Bitmap^ ToBitmap(
Graphics^ graphics,
bool visibleClipOnly
)
[<ExtensionAttribute>]
static member ToBitmap :
graphics : Graphics *
visibleClipOnly : bool -> Bitmap
- graphics Graphics
- The Graphics instance to be converted.
- visibleClipOnly Boolean
- 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.
BitmapA
Bitmap object that contains the image content of the source
Graphics object, or
, when the required area of
graphics is empty.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).
This method is supported on Windows only.