SkiaSharp 线和路径SkiaSharp Lines and Paths

下载示例下载示例Download Sample Download the sample

使用 SkiaSharp 绘制线条和图形路径Use SkiaSharp to draw lines and graphics paths

上一节所示的 SkiaSharpSKCanvas类包括几种方法来绘制圆、 椭圆、 矩形、 圆角的矩形、 文本和位图。The previous section demonstrated that the SkiaSharp SKCanvas class includes several methods to draw circles, ovals, rectangles, rounded rectangles, text, and bitmaps. 此部分和更高版本的部分介绍各种类连接与创建和呈现图形路径This section and later sections cover the various classes connected with creating and rendering graphics paths.

图形路径是到绘制的直线和曲线 SkiaSharp 中的最通用的方法。The graphics path is the most generalized approach to drawing lines and curves in SkiaSharp. 本部分介绍如何使用 SKPath 对象绘制的直线,并使用一系列小直线,直线 (称为折线) 绘制可以从算法上定义的曲线。This section covers using an SKPath object to draw straight lines, and to use a collection of tiny straight lines (called a polyline) to draw curves that you can define algorithmically. 在后面的部分 SkiaSharp 曲线和路径讨论了各种类型的支持的曲线SKPathA later section on SkiaSharp Curves and Paths discusses the various sorts of curves supported by SKPath.

在本部分中的所有示例程序都显示在标题下线和路径中的主页 SkiaSharpFormsDemos 程序,然后在路径该解决方案的文件夹。All the sample programs in this section appear under the heading Lines and Paths in the home page of the SkiaSharpFormsDemos program, and in the Paths folder of that solution.

线和笔划大写字母Lines and Stroke Caps

了解如何使用 SkiaSharp 绘制不同笔划大写字母的线条。Learn how to use SkiaSharp to draw lines with different stroke caps.

路径基础知识Path Basics

了解 SkiaSharpSKPath组合的直线和曲线的对象。Explore the SkiaSharp SKPath object for combining lines and curves.

路径填充类型The Path Fill Types

发现不同的效果可能使用 SkiaSharp 路径填充类型。Discover the different effects possible with SkiaSharp path fill types.

折线和参数等式Polylines and Parametric Equations

使用 SkiaSharp 来呈现可以定义与参数方程确定任何行。Use SkiaSharp to render any line you can define with parametric equations.

点和短划线Dots and Dashes

主中 SkiaSharp 绘制点线和虚线线条的复杂性。Master the intricacies of drawing dotted and dashed lines in SkiaSharp.

手指绘图Finger Painting

使用手指在画布上绘制。Use your fingers to paint on the canvas.