Table of Contents

Class SkiaGraphics

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

Implements Graphics over SKCanvas or SKBitmap.

public class SkiaGraphics : Graphics, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, IGraphics, IDisposable
Inheritance
SkiaGraphics
Implements
Extension Methods

Constructors

SkiaGraphics()

Initializes a new instance of the SkiaGraphics class.

SkiaGraphics(SKBitmap)

Initializes a new instance of the SkiaGraphics class on the specified bitmap.

SkiaGraphics(SKCanvas)

Initializes a new instance of the SkiaGraphics class on the specified SKCanvas.

Properties

BackendType

Gets the type of graphics backend used by the implementation.

Bitmap

Gets or sets SKBitmap where drawing will be performed.

Canvas

Gets or sets SKCanvas where drawing will be performed.

InitialMatrix

Gets or sets the initial transformation matrix applied to the canvas before the first drawing is performed.

InterpolationMode

Gets or sets the interpolation mode associated with this Graphics.

IsOk

Returns true if the object is ok to use.

IsScaled

Gets a value indicating whether the object is scaled.

IsUnscaled

Gets a value indicating whether the scale factor is 1f.

NativeObject

Gets native drawing context.

OriginalScaleFactor

Gets or sets original scale factor applied to the canvas before the first drawing is performed.

UseUnscaledDrawImage

Gets or sets whether 'DrawImage' methods draw unscaled image.

Methods

AfterDrawImage()

Called after any draw image operation.

BeforeDrawImage(ref Image, ref PointD)

Called before any draw image operation.

BeforeDrawImage(ref Image, ref RectD)

Called before any draw image operation.

Circle(Pen, Brush, PointD, float)

Calls FillCircle(Brush, PointD, float) and than DrawCircle(Pen, PointD, float).

ClipRect(RectD, bool)

Clips the canvas to the specified rectangle.

ClipRegion(Region)

Modify the current clip with the specified region.

CreatePiePath(PointD, float, float, float)

Creates an SKPath representing a pie segment.

DrawArc(Pen, PointD, float, float, float)

Draws an arc representing a portion of a circle specified by a center PointD and a radius.

DrawBezier(Pen, PointD, PointD, PointD, PointD)

Draws a Bezier spline defined by four PointD structures.

DrawBeziers(Pen, ReadOnlySpan<PointD>)

Draws a series of Bezier splines from an array of PointD structures.

DrawCircle(Pen, PointD, float)

Draws an circle specified by a center PointD and a radius.

DrawEllipse(Pen, RectD)

Draws an ellipse defined by a bounding RectD.

DrawImage(Image, PointD)

Draws the specified Image, using its original size, at the specified location.

DrawImage(Image, RectD)

Draws an image into the region defined by the specified RectD.

DrawLine(Pen, PointD, PointD)

Draws a line connecting two points.

DrawLines(Pen, ReadOnlySpan<PointD>)

Draws a series of line segments that connect an array of PointD structures.

DrawPath(Pen, GraphicsPath)

Draws a GraphicsPath.

DrawPie(Pen, PointD, float, float, float)

Draws an outline of a pie section defined by a circle specified by a center PointD and a radius.

DrawPolygon(Pen, ReadOnlySpan<PointD>)

Draws a polygon defined by an array of PointD structures.

DrawRectangle(Pen, RectD)

Draws a rectangle specified by a RectD structure.

DrawRoundedRectangle(Pen, RectD, float)

Draws a rounded rectangle specified by a RectD and a corner radius.

DrawText(ReadOnlySpan<char>, Font, Brush, PointD)

Draws text string with the specified location, Brush and Font objects.

DrawText(ReadOnlySpan<char>, Font, Brush, RectD)

Draws text string with the specified bounds, Brush and Font objects.

DrawText(ReadOnlySpan<char>, PointD, Font, Color, Color)

Draws text with the specified font, background and foreground colors. This is the fastest method to draw text.

DrawTextWithAngle(ReadOnlySpan<char>, PointD, Font, Color, Color, float)

Draws text with the specified angle, font, background and foreground colors.

Ellipse(Pen, Brush, RectD)

Calls FillEllipse(Brush, RectD) and than DrawEllipse(Pen, RectD).

FillCircle(Brush, PointD, float)

Fills the interior of a circle specified by a center PointD and a radius.

FillEllipse(Brush, RectD)

Fills the interior of an ellipse defined by a bounding rectangle specified by a RectD structure.

FillPath(Brush, GraphicsPath)

Fills the interior of a GraphicsPath.

FillPie(Brush, PointD, float, float, float)

Fills the interior of a pie section defined by a circle specified by a center PointD and a radius.

FillPolygon(Brush, ReadOnlySpan<PointD>, FillMode)

Fills the interior of a polygon defined by an array of PointD structures.

FillRectangle(Brush, RectD)

Fills the interior of a rectangle specified by a RectD structure. Rectangle is specified in device-independent units.

FillRectangle(Brush, RectD, GraphicsUnit)

Fills the interior of a rectangle specified by a RectD structure. Rectangle is specified in device-independent units.

FillRoundedRectangle(Brush, RectD, float)

Fills the interior of a rounded rectangle specified by a RectD and a corner radius.

GetDPI()

Returns the DPI of the display used by this object.

GetTextExtent(ReadOnlySpan<char>, Font)

Gets the dimensions of the string using the specified font.

Path(Pen, Brush, GraphicsPath)

Calls FillPath(Brush, GraphicsPath) and than DrawPath(Pen, GraphicsPath).

Pie(Pen, Brush, PointD, float, float, float)

Calls FillPie(Brush, PointD, float, float, float) and than DrawPie(Pen, PointD, float, float, float).

Polygon(Pen?, Brush, ReadOnlySpan<PointD>, FillMode)

Calls FillPolygon(Brush, ReadOnlySpan<PointD>, FillMode) and than DrawPolygon(Pen, ReadOnlySpan<PointD>).

Rectangle(Pen, Brush, RectD)

Calls FillRectangle(Brush, RectD) and than DrawRectangle(Pen, RectD).

Restore()

Restore the saved canvas state.

RoundedRectangle(Pen, Brush, RectD, float)

Calls FillRoundedRectangle(Brush, RectD, float) and than DrawRoundedRectangle(Pen, RectD, float).

Save()

Saves the current state of the canvas.

SetHandlerTransform(TransformMatrix)

Sets transform matrix of the handler.

SetPixel(PointD, Pen)

Sets pixel at the specified coordinates to the color of the specified pen.

SetPixel(float, float, Color)

Sets pixel at the specified coordinates to the specified color.

SetPixel(float, float, Pen)

Sets pixel at the specified coordinates to the specified color.