Drawing of 2D graphics using SkiaSharp library
In This Topic
The Vintasoft.Imaging.dll assembly defines interfaces (
IRegion,
IDrawingPen,
IDrawingBrush,
IDrawingSolidBrush,
IDrawingHatchBrush,
IDrawingImageBrush,
IDrawingLinearGradientBrush) and abstract classes (
RasterDrawingEngine,
DrawingFactory,
DrawingFont,
DrawingFontMetrics,
GraphicsPathBase) for drawing of 2D graphics.
The Vintasoft.Imaging.Drawing.SkiaSharp.dll assembly contains implementations of interfaces and abstract classes for drawing of 2D graphics using SkiaSharp library:
- SkiaSharpPen - defines the pen, which is based on SkiaSharp.SKPaint and is used to draw lines and curves.
- SkiaSharpBrush - defines the abstract base class of drawing brush based on SkiaSharp.SKPaint that used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths.
- SkiaSharpSolidBrush - defines the solid brush based on SkiaSharp.SKPaint that used to fill the interiors of graphical shapes use single color.
- SkiaSharpLinearGradientBrush - defines the solid brush, which is based on SkiaSharp.SKPaint and paints an area with a linear gradient.
- SkiaSharpImageBrush - defines the image brush based on SkiaSharp.SKPaint that uses an image to fill the interior of a shape.
- SkiaSharpFont - defines the font, which is based on SkiaSharp.SKFont.
- SkiaSharpFontMetrics - provides the class that contains measurements for a SkiaSharpFont.
- SkiaSharpRegion - defines the region based on SkiaSharp.SKRegion that is used to describe the interior of a graphics shape composed of rectangles and paths.
- SkiaSharpPath - defines the graphics path based on SkiaSharp.SKPath that provides series of connected lines and curves.
- SkiaSharpDrawingEngine - provides the 2D raster drawing engine, which is based on SkiaSharp engine.
- SkiaSharpDrawingFactory - represents the drawing factory for SkiaSharpDrawingEngine.
By default the SDK will search and use the Vintasoft.Imaging.Drawing.SkiaSharp.dll assembly for drawing of 2D graphics if SDK is used in Linux or macOS.
Also it is possible to explicitly specify that SDK should use SkiaSharp library for drawing of 2D graphics using the following code:
/// <summary>
/// Sets the SKIA Sharp drawing factory as a default drawing factory.
/// </summary>
public static void SetSkiaSharpSdkDrawing()
{
// Skia - cross platform drawing engine
Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault();
}
''' <summary>
''' Sets the SKIA Sharp drawing factory as a default drawing factory.
''' </summary>
Public Shared Sub SetSkiaSharpSdkDrawing()
' Skia - cross platform drawing engine
Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault()
End Sub