Skip to content

Commit f0460aa

Browse files
committed
Great!
1 parent 19833cb commit f0460aa

File tree

1 file changed

+38
-21
lines changed

1 file changed

+38
-21
lines changed

binding/SkiaSharp/SKSurface.cs

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,59 @@ namespace SkiaSharp
99
/// Represents the backend/results of drawing to a canvas.
1010
/// </summary>
1111
/// <remarks>
12+
/// <para>
1213
/// The surface represents the backend/results of drawing to a canvas. For raster
1314
/// drawing, the surface will be pixels, but (for example) when drawing into a
1415
/// PDF or <see cref="SkiaSharp.SKPicture" /> canvas, the surface stores the recorded
1516
/// commands.
17+
/// </para>
18+
/// <para>
1619
/// The surface always has non-zero dimensions. If there is a request for a new
1720
/// surface, and either of the requested dimensions are zero, then <see langword="null" /> will
1821
/// be returned.
22+
/// </para>
23+
/// <para>
1924
/// Once you create a surface with one of its <see cref="SkiaSharp.SKSurface.Create(SKImageInfo)" />
2025
/// methods, you can draw into the canvas returned by the
2126
/// <see cref="SkiaSharp.SKSurface.Canvas" /> property. Once the drawing is complete, you
2227
/// can retrieve an <see cref="SkiaSharp.SKImage" /> by calling the
2328
/// <see cref="SkiaSharp.SKSurface.Snapshot()" /> method.
24-
/// ## Examples
25-
/// ```csharp
29+
/// </para>
30+
/// </remarks>
31+
/// <example>
32+
/// <code language="csharp">
2633
/// var info = new SKImageInfo(256, 256);
27-
/// using (var surface = SKSurface.Create(info)) {
28-
/// SKCanvas canvas = surface.Canvas;
29-
/// canvas.Clear(SKColors.White);
30-
/// // configure our brush
31-
/// var redBrush = new SKPaint {
32-
/// Color = new SKColor(0xff, 0, 0),
33-
/// IsStroke = true
34-
/// };
35-
/// var blueBrush = new SKPaint {
36-
/// Color = new SKColor(0, 0, 0xff),
37-
/// IsStroke = true
38-
/// };
39-
/// for (int i = 0; i &lt; 64; i += 8) {
40-
/// var rect = new SKRect(i, i, 256 - i - 1, 256 - i - 1);
41-
/// canvas.DrawRect(rect, (i % 16 == 0) ? redBrush : blueBrush);
42-
/// }
34+
/// using (var surface = SKSurface.Create(info))
35+
/// {
36+
/// SKCanvas canvas = surface.Canvas;
37+
/// canvas.Clear(SKColors.White);
38+
///
39+
/// // configure our brush
40+
/// var redBrush = new SKPaint
41+
/// {
42+
/// Color = new SKColor(0xff, 0, 0),
43+
/// IsStroke = true
44+
/// };
45+
/// var blueBrush = new SKPaint
46+
/// {
47+
/// Color = new SKColor(0, 0, 0xff),
48+
/// IsStroke = true
49+
/// };
50+
///
51+
/// for (int i = 0; i &lt; 64; i += 8)
52+
/// {
53+
/// var rect = new SKRect(i, i, 256 - i - 1, 256 - i - 1);
54+
/// canvas.DrawRect(rect, (i % 16 == 0) ? redBrush : blueBrush);
55+
/// }
4356
/// }
44-
/// ```
57+
/// </code>
58+
/// <para>
4559
/// The example above produces the following:
46-
/// ![SKSurface](~/docs-images/surface-rects.png "SKSurface")
47-
/// </remarks>
60+
/// </para>
61+
/// <para>
62+
/// <img src="~/docs-images/surface-rects.png" alt="SKSurface" />
63+
/// </para>
64+
/// </example>
4865
public unsafe class SKSurface : SKObject, ISKReferenceCounted
4966
{
5067
internal SKSurface (IntPtr h, bool owns)

0 commit comments

Comments
 (0)