Share via


SkiaCanvas Class

Definition

Implements a canvas that uses SkiaSharp for rendering graphics.

public ref class SkiaCanvas : Microsoft::Maui::Graphics::AbstractCanvas<Microsoft::Maui::Graphics::Skia::SkiaCanvasState ^>, Microsoft::Maui::Graphics::IBlurrableCanvas
public class SkiaCanvas : Microsoft.Maui.Graphics.AbstractCanvas<Microsoft.Maui.Graphics.Skia.SkiaCanvasState>, Microsoft.Maui.Graphics.IBlurrableCanvas
type SkiaCanvas = class
    inherit AbstractCanvas<SkiaCanvasState>
    interface IBlurrableCanvas
Public Class SkiaCanvas
Inherits AbstractCanvas(Of SkiaCanvasState)
Implements IBlurrableCanvas
Inheritance
Implements

Remarks

SkiaCanvas provides a implementation of the standard canvas drawing operations using the SkiaSharp graphics library.

Constructors

SkiaCanvas()

Initializes a new instance of the SkiaCanvas class.

Properties

Alpha
Antialias

Gets or sets a value indicating whether anti-aliasing is enabled.

AssignedStrokeLimit (Inherited from AbstractCanvas<TState>)
BlendMode
Canvas

Gets or sets the underlying SkiaSharp canvas.

CurrentState (Inherited from AbstractCanvas<TState>)
DisplayScale

Gets the display scale factor used by the canvas.

FillColor
Font
FontColor
FontSize
LimitStrokeScaling (Inherited from AbstractCanvas<TState>)
LimitStrokeScalingEnabled (Inherited from AbstractCanvas<TState>)
MiterLimit
PlatformStrokeSize
StrokeColor
StrokeDashOffset (Inherited from AbstractCanvas<TState>)
StrokeDashPattern (Inherited from AbstractCanvas<TState>)
StrokeLimit (Inherited from AbstractCanvas<TState>)
StrokeLineCap
StrokeLineJoin
StrokeSize (Inherited from AbstractCanvas<TState>)

Methods

ClipPath(PathF, WindingMode)
ClipRectangle(Single, Single, Single, Single)
ConcatenateTransform(Matrix3x2) (Inherited from AbstractCanvas<TState>)
Dispose()

Releases all resources used by the SkiaCanvas instance.

DrawArc(Single, Single, Single, Single, Single, Single, Boolean, Boolean) (Inherited from AbstractCanvas<TState>)
DrawEllipse(Single, Single, Single, Single) (Inherited from AbstractCanvas<TState>)
DrawImage(IImage, Single, Single, Single, Single)
DrawLine(Single, Single, Single, Single) (Inherited from AbstractCanvas<TState>)
DrawPath(PathF) (Inherited from AbstractCanvas<TState>)
DrawRectangle(Single, Single, Single, Single) (Inherited from AbstractCanvas<TState>)
DrawRoundedRectangle(Single, Single, Single, Single, Single) (Inherited from AbstractCanvas<TState>)
DrawString(String, Single, Single, HorizontalAlignment)
DrawString(String, Single, Single, Single, Single, HorizontalAlignment, VerticalAlignment, TextFlow, Single)
DrawText(IAttributedText, Single, Single, Single, Single)
FillArc(Single, Single, Single, Single, Single, Single, Boolean)

Fills an arc within the specified rectangle from the start angle to the end angle.

FillEllipse(Single, Single, Single, Single)
FillPath(PathF, WindingMode)
FillRectangle(Single, Single, Single, Single)

Fills a rectangle at the specified coordinates with the current fill paint.

FillRoundedRectangle(Single, Single, Single, Single, Single)
GetStringSize(String, IFont, Single, HorizontalAlignment, VerticalAlignment) (Inherited from AbstractCanvas<TState>)
GetStringSize(String, IFont, Single) (Inherited from AbstractCanvas<TState>)
PlatformConcatenateTransform(Matrix3x2)
PlatformDrawArc(Single, Single, Single, Single, Single, Single, Boolean, Boolean)
PlatformDrawEllipse(Single, Single, Single, Single)
PlatformDrawLine(Single, Single, Single, Single)
PlatformDrawPath(PathF)
PlatformDrawRectangle(Single, Single, Single, Single)
PlatformDrawRoundedRectangle(Single, Single, Single, Single, Single)
PlatformRotate(Single, Single, Single, Single)
PlatformRotate(Single, Single)
PlatformScale(Single, Single)
PlatformSetStrokeDashPattern(Single[], Single, Single)
PlatformTranslate(Single, Single)
ResetState()
RestoreState()
Rotate(Single, Single, Single) (Inherited from AbstractCanvas<TState>)
Rotate(Single) (Inherited from AbstractCanvas<TState>)
SaveState()
Scale(Single, Single) (Inherited from AbstractCanvas<TState>)
SetBlur(Single)
SetDisplayScale(Single)

Sets the display scale factor for the canvas.

SetFillPaint(Paint, RectF)

Sets the fill paint for the canvas.

SetShadow(SizeF, Single, Color)
StateRestored(SkiaCanvasState)
StateRestored(TState) (Inherited from AbstractCanvas<TState>)
SubtractFromClip(Single, Single, Single, Single)
Translate(Single, Single) (Inherited from AbstractCanvas<TState>)

Extension Methods

ClipPath(ICanvas, PathF, WindingMode)
ClipRectangle(ICanvas, Rect)
ClipRectangle(ICanvas, RectF)
DrawArc(ICanvas, Rect, Single, Single, Boolean, Boolean)

Draws the arc. This is a helper method to draw an arc when you have a rectangle already defined for the ellipse bounds.

DrawArc(ICanvas, RectF, Single, Single, Boolean, Boolean)

Draws the arc. This is a helper method to draw an arc when you have a rectangle already defined for the ellipse bounds.

DrawCircle(ICanvas, Point, Double)
DrawCircle(ICanvas, PointF, Single)
DrawCircle(ICanvas, Single, Single, Single)
DrawEllipse(ICanvas, Rect)
DrawEllipse(ICanvas, RectF)
DrawLine(ICanvas, PointF, PointF)

Draws a line between two points.

DrawPath(ICanvas, PathF)
DrawRectangle(ICanvas, Rect)

Draws the outline of a rectangle.

DrawRectangle(ICanvas, RectF)

Draws the outline of a rectangle.

DrawRoundedRectangle(ICanvas, Rect, Double, Double, Double, Double)
DrawRoundedRectangle(ICanvas, Rect, Double)
DrawRoundedRectangle(ICanvas, RectF, Single, Single, Single, Single)
DrawRoundedRectangle(ICanvas, RectF, Single, Single)
DrawRoundedRectangle(ICanvas, RectF, Single)
DrawRoundedRectangle(ICanvas, Single, Single, Single, Single, Single, Single, Single, Single)
DrawString(ICanvas, String, Rect, HorizontalAlignment, VerticalAlignment, TextFlow, Single)
DrawString(ICanvas, String, RectF, HorizontalAlignment, VerticalAlignment, TextFlow, Single)
EnableDefaultShadow(ICanvas, Single)

Enables the default shadow.

FillArc(ICanvas, Rect, Single, Single, Boolean)

Fills the arc. This is a helper method to fill an arc when you have a rectangle already defined for the ellipse bounds.

FillArc(ICanvas, RectF, Single, Single, Boolean)

Fills the arc. This is a helper method to fill an arc when you have a rectangle already defined for the ellipse bounds.

FillArc(ICanvas, Single, Single, Single, Single, Single, Single, Paint, Boolean)

Fills the arc with the specified paint. This is a helper method for when filling an arc with a gradient, so that you don't need to worry about calculating the gradient handle locations based on the rectangle size and ___location.

FillCircle(ICanvas, Point, Double)
FillCircle(ICanvas, PointF, Single)
FillCircle(ICanvas, Single, Single, Single)
FillEllipse(ICanvas, Rect)
FillEllipse(ICanvas, RectF)
FillPath(ICanvas, PathF, WindingMode)

Fills the specified path using the current fill color and the specified winding rule.

FillPath(ICanvas, PathF)

Fills the specified path using the current fill color and the non-zero winding rule.

FillRectangle(ICanvas, Rect)

Fills a rectangle with the current brush.

FillRectangle(ICanvas, RectF)
FillRoundedRectangle(ICanvas, Rect, Double, Double, Double, Double)
FillRoundedRectangle(ICanvas, Rect, Double)
FillRoundedRectangle(ICanvas, RectF, Single, Single, Single, Single)
FillRoundedRectangle(ICanvas, RectF, Single, Single)
FillRoundedRectangle(ICanvas, RectF, Single)
FillRoundedRectangle(ICanvas, Single, Single, Single, Single, Single, Single, Single, Single)
ResetStroke(ICanvas)

Resets the stroke to the default settings:

  • Stroke Size: 1
  • Stroke Dash Pattern: None
  • Stroke Location: Center
  • Stroke Line Join: Miter
  • Stroke Line Cap: Butt
  • Stroke Brush: None
  • Stroke Color: Black
SetFillPaint(ICanvas, Paint, Point, Point)
SetFillPaint(ICanvas, Paint, PointF, PointF)
SetFillPaint(ICanvas, Paint, Rect)
SetFillPaint(ICanvas, Paint, RectF)
SetFillPattern(ICanvas, IPattern, Color)
SetFillPattern(ICanvas, IPattern)
SubtractFromClip(ICanvas, Rect)
SubtractFromClip(ICanvas, RectF)
SetFillImage(ICanvas, IImage)

Applies to