diff --git a/docs/en/SkiaSharp/SKPaint.xml b/docs/en/SkiaSharp/SKPaint.xml index ad547e13..6ba4ea04 100644 --- a/docs/en/SkiaSharp/SKPaint.xml +++ b/docs/en/SkiaSharp/SKPaint.xml @@ -19,6 +19,55 @@ Holds the style and color information about how to draw geometries, text and bitmaps. + Anytime you draw something in SkiaSharp, and want to specify what color it is, or how it blends with the background, or what style or font to draw it in, you specify those attributes in a paint. + Unlike , an SKPaint object do not maintain an internal stack of state.   That is, there is no save/restore on a paint. However, SKPaint objects are relatively light-weight, so the client may create and maintain any number of paint objects, each set up for a particular use.  + Factoring all of these color and stylistic attributes out of the canvas state, and into (multiple) paint objects, allows the save and restore operations on the  to be that much more efficient, as all they have to do is maintain the stack of matrix and clip settings. + + The example above produces the following: + + + + This shows three different paints, each set up to draw in a different style. Now the caller can intermix these paints freely, either using them as is, or modifying them as the drawing proceeds. + Beyond simple attributes such as color, strokes, and text values, paints support effects. These are subclasses of different aspects of the drawing pipeline, that when referenced by a paint (each of them is reference-counted), are called to override some part of the drawing pipeline. + For example, to draw using a gradient instead of a single color, assign a SkShader to the paint. + + + + + + + + + + + + Now, anything drawn with that paint will be drawn with the gradient specified in the call to CreateLinearGradient. + There are five types of effects that can be assigned to an  object: + + + + BlendMode - Blend modes and Duff-Porter transfer modes. + + + ColorFilter - Modifies the source colors before applying the BlendMode. + + + MaskFilter - Modification of the alpha mask before it is colorized and drawn (for example, blur) + + + PathEffect - Modification of the geometry (path) before the alpha mask is generated (for example, dashing) + + + Shader - Gradients and bitmap patterns. + + + + diff --git a/docs/en/SkiaSharp/_images/SKPaintText.png b/docs/en/SkiaSharp/_images/SKPaintText.png new file mode 100644 index 00000000..45063e64 Binary files /dev/null and b/docs/en/SkiaSharp/_images/SKPaintText.png differ diff --git a/docs/en/SkiaSharp/_images/gradient.png b/docs/en/SkiaSharp/_images/gradient.png new file mode 100644 index 00000000..31400ac1 Binary files /dev/null and b/docs/en/SkiaSharp/_images/gradient.png differ