ICanvas Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a platform-agnostic canvas on which 2D graphics can be drawn using types from the Microsoft.Maui.Graphics namespace.
public interface class ICanvas
public interface ICanvas
type ICanvas = interface
Public Interface ICanvas
- Derived
Properties
Alpha |
Sets the opacity of am object. |
Antialias |
Sets a value that indicates whether to use anti-aliasing is enabled. |
BlendMode |
Sets the blend mode, which determines what happens when an object is rendered on top of an existing object. |
DisplayScale |
Gets or sets a value that represents the scaling factor to scale the UI by. |
FillColor |
Sets the color used to paint an object's interior. |
Font |
Sets the font used when drawing text. |
FontColor |
Sets the font color when drawing text. |
FontSize |
Sets the size of the font used when drawing text. |
MiterLimit |
Sets the limit of the miter length of line joins in an object. |
StrokeColor |
Sets the Color used to paint an object's outline. |
StrokeDashOffset |
Sets the distance within the dash pattern where a dash begins. |
StrokeDashPattern |
Sets the pattern of dashes and gaps that are used to outline an object. |
StrokeLineCap |
Sets the shape at the start and end of a line. |
StrokeLineJoin |
Sets the type of join used at the vertices of a shape. |
StrokeSize |
Sets the width of the stroke used to draw an object's outline. |
Methods
ClipPath(PathF, WindingMode) |
Clips an object so that only the area that's within the region of a PathF object will be visible. |
ClipRectangle(Single, Single, Single, Single) |
Clips an object so that only the area that's within the region of the rectangle will be visible. |
ConcatenateTransform(Matrix3x2) |
Applies transformation specified by |
DrawArc(Single, Single, Single, Single, Single, Single, Boolean, Boolean) |
Draws an arc onto the canvas. |
DrawEllipse(Single, Single, Single, Single) |
Draws an ellipse onto the canvas. |
DrawImage(IImage, Single, Single, Single, Single) |
Draws an image onto the canvas. |
DrawLine(Single, Single, Single, Single) |
Draws a line between two points onto the canvas. |
DrawPath(PathF) |
Draws the specified |
DrawRectangle(Single, Single, Single, Single) |
Draws a rectangle onto the canvas. |
DrawRoundedRectangle(Single, Single, Single, Single, Single) |
Draws a rectangle with rounded corners onto the canvas. |
DrawString(String, Single, Single, HorizontalAlignment) |
Draws a text string onto the canvas. |
DrawString(String, Single, Single, Single, Single, HorizontalAlignment, VerticalAlignment, TextFlow, Single) |
Draws a text string within a bounding box onto the canvas. |
DrawText(IAttributedText, Single, Single, Single, Single) |
Draws attributed text within a bounding box onto the canvas. |
FillArc(Single, Single, Single, Single, Single, Single, Boolean) |
Draws a filled arc onto the canvas. |
FillEllipse(Single, Single, Single, Single) |
Draws a filled ellipse onto the canvas. |
FillPath(PathF, WindingMode) |
Draws and fills the specified |
FillRectangle(Single, Single, Single, Single) |
Draws a filled rectangle onto the canvas. |
FillRoundedRectangle(Single, Single, Single, Single, Single) |
Draws a filled rectangle with rounded corners onto the canvas. |
GetStringSize(String, IFont, Single, HorizontalAlignment, VerticalAlignment) |
Calculates the area a string would occupy if drawn on the canvas. |
GetStringSize(String, IFont, Single) |
Calculates the area a string would occupy if drawn on the canvas. |
ResetState() |
Resets the graphics state to its default values. |
RestoreState() |
Restores the graphics state to the most recently saved state. |
Rotate(Single, Single, Single) |
Rotates a graphical object around a point. |
Rotate(Single) |
Rotates a graphical object around the upper-left corner of the canvas (0,0). |
SaveState() |
Saves the current graphics state. |
Scale(Single, Single) |
Changes the size of a graphical object by scaling it. |
SetFillPaint(Paint, RectF) |
Sets |
SetShadow(SizeF, Single, Color) |
Adds a shadow to a graphical object. |
SubtractFromClip(Single, Single, Single, Single) |
Clips an object so that only the area outside the of a rectangle will be visible. |
Translate(Single, Single) |
Shifts a graphical object in horizontal and vertical directions. |