This commit is contained in:
Miguel de Icaza 2016-03-02 23:49:43 -05:00
Родитель 8ada839f6f
Коммит cf6f94c1b9
4 изменённых файлов: 199 добавлений и 50 удалений

Просмотреть файл

@ -13,22 +13,18 @@
<summary>Encapsulates all of the state about drawing into a device (bitmap).</summary>
<remarks>
<para>Encapsulates all of the state about drawing into a device (bitmap).</para>
<para>
</para>
<para></para>
<para>This includes a reference to the device itself, and a stack of matrix/clip values. For any given draw call (e.g. drawRect), the geometry of the object being drawn is transformed by the concatenation of all the matrices in the stack. The transformed geometry is clipped by the intersection of all of the clips in the stack.</para>
<para>
</para>
<para></para>
<para>While the Canvas holds the state of the drawing device, the state (style) of the object being drawn is held by the Paint, which is provided as a parameter to each of the draw() methods. The Paint holds attributes such as color, typeface, the text size, the stroke width, the shader (for example, gradients, patterns), etc.</para>
<para>
</para>
<para></para>
<para>The SkCanvas is returned when accessing the <see cref="P:SkiaSharp.SKSurface.Canvas" /> property of a surface.</para>
<para>Transformations</para>
<para>The <see cref="T:SkiaSharp.SKCanvas" /> supports a number of 2D transformations.   Unlike other 2D graphic systems like CoreGraphics or Cairo, SKCanvas extends the transformations to include perspectives.   </para>
<para>You can use the <see cref="M:SkiaSharp.SKCanvas.Scale" />, <see cref="M:SkiaSharp.SKCanvas.Skew" />, <see cref="M:SkiaSharp.SKCanvas.Translate" />, <see cref="M:SkiaSharp.SKCanvas.RotateDegrees" />, <see cref="M:SkiaSharp.SKCanvas.RotateRadians" /> to perform some of the most common 2D transformations.   </para>
<para>For more control you can use the <see cref="M:SkiaSharp.SKCanvas.SetMatrix" /> to set an arbitrary transformation using the <see cref="T:SkiaSharp.SKMatrix" /> and the <see cref="M:SkiaSharp.SKCanvas.Concat" /> to concatenate an <see cref="T:SkiaSharp.SKMatrix" /> transformation to the current matrix in use.</para>
<para>The <see cref="M:SkiaSharp.SKCanvas.ResetMatrix" /> can be used to reset the state of the matrix</para>
<para>
</para>
<para></para>
<para>Drawing</para>
<para>The drawing operations can take a <see cref="T:SkiaSharp.SKPaint" /> parameter to affect their drawing.  You use <see cref="T:SkiaSharp.SKPaint" /> objects to cache the style and color information to draw geometries, texts and bitmaps.</para>
<para>Clipping Path</para>
@ -36,12 +32,9 @@
<para>It is possible to save the current transformations by calling the <see cref="M:SkiaSharp.SKCanvas.Save" /> method which preserves the current transformation matrix, you can then alter the matrix and restore the previous state by using the <see cref="M:SkiaSharp.SKCanvas.Restore" /> or <see cref="M:SkiaSharp.SKCanvas.RestoreToCount" /> methods.   </para>
<para>Additionally, it is possible to push a new state with <see cref="M:SkiaSharp.SKCanvas.SaveLayer" /> which will make an offscreen copy of a region, and once the drawing is completed, calling the <see cref="M:SkiaSharp.SKCanvas.Restore" /> method which copies the offscreen bitmap into this canvas.</para>
<para>The example below shows a typical use:</para>
<para>
</para>
<para>
</para>
<para>
</para>
<para></para>
<para></para>
<para></para>
<example>
<code lang="C#"><![CDATA[using (var surface = SKSurface.Create (width: 640, height: 480, SKColorType.N_32, SKAlphaType.Premul)) {
SKCanvas canvas = surface.Canvas;
@ -272,8 +265,7 @@
<param name="mode">The transfer mode for the color.</param>
<summary>Fills the current clipping path with the specified color using the specified transfer mode.</summary>
<remarks>
<para>
</para>
<para></para>
</remarks>
</Docs>
</Member>
@ -463,8 +455,7 @@
<param name="paint">The paint used to draw the picture, or <see langword="null" />.</param>
<summary>Draws a picture on the canvas.</summary>
<remarks>
<para>
</para>
<para></para>
</remarks>
</Docs>
</Member>
@ -565,20 +556,15 @@
<summary>Draws an array of points, lines or a polygon in the canvas.</summary>
<remarks>
<para>For all modes, the count parameter is interpreted as the total number of points. For kLine mode, count/2 line segments are drawn.</para>
<para>
</para>
<para></para>
<para>For point mode, each point is drawn centered at its coordinate, and its size is specified by the paint's stroke-width. It draws as a square, unless the paint's cap-type is round, in which the points are drawn as circles.</para>
<para>
</para>
<para></para>
<para>For line mode, each pair of points is drawn as a line segment, respecting the paint's settings for cap, join and width. </para>
<para>
</para>
<para></para>
<para>For polygon mode, the entire array is drawn as a series of connected line segments.</para>
<para>
</para>
<para></para>
<para>Note that, while similar, the line and polygon modes draw slightly differently than the equivalent path built with a series of move to, line to calls, in that the path will draw all of its contours at once, with no interactions if contours intersect each other (think XOR xfermode).  DrawPoints always draws each element one at a time.</para>
<para>
</para>
<para></para>
</remarks>
</Docs>
</Member>
@ -630,6 +616,35 @@
</remarks>
</Docs>
</Member>
<Member MemberName="DrawText">
<MemberSignature Language="C#" Value="public void DrawText (IntPtr buffer, int length, SkiaSharp.SKPoint[] points, SkiaSharp.SKPaint paint);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DrawText(native int buffer, int32 length, valuetype SkiaSharp.SKPoint[] points, class SkiaSharp.SKPaint paint) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.IntPtr" />
<Parameter Name="length" Type="System.Int32" />
<Parameter Name="points" Type="SkiaSharp.SKPoint[]" />
<Parameter Name="paint" Type="SkiaSharp.SKPaint" />
</Parameters>
<Docs>
<param name="buffer">Contains a pointer to a region holding UTF-8 encoded text to draw.</param>
<param name="length">Number of bytes to read from the <paramref name="buffer." /></param>
<param name="points">Describes the position for each glyph in the <paramref name="text" /> string.</param>
<param name="paint">The paint used to draw the text.</param>
<summary>Draws text from a UTF-8 buffer at specified locations on the canvas.</summary>
<remarks>
<para>Draw the text, with each character/glyph origin specified by the <paramref name="points" /> array. The origin is interpreted by the Align setting in the paint.</para>
<para></para>
<para>The <paramref name="buffer" /> parameter is a pointer to a region in memory that contains a UTF-8 encoded block of text.   This only consumes up to <paramref name="length" /> bytes from the buffer.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="DrawText">
<MemberSignature Language="C#" Value="public void DrawText (string text, float x, float y, SkiaSharp.SKPaint paint);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DrawText(string text, float32 x, float32 y, class SkiaSharp.SKPaint paint) cil managed" />
@ -657,6 +672,37 @@
</remarks>
</Docs>
</Member>
<Member MemberName="DrawText">
<MemberSignature Language="C#" Value="public void DrawText (IntPtr buffer, int length, float x, float y, SkiaSharp.SKPaint paint);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DrawText(native int buffer, int32 length, float32 x, float32 y, class SkiaSharp.SKPaint paint) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.IntPtr" />
<Parameter Name="length" Type="System.Int32" />
<Parameter Name="x" Type="System.Single" />
<Parameter Name="y" Type="System.Single" />
<Parameter Name="paint" Type="SkiaSharp.SKPaint" />
</Parameters>
<Docs>
<param name="buffer">Contains a pointer to a region holding UTF-8 encoded text to draw.</param>
<param name="length">Number of bytes to read from the <paramref name="buffer." /></param>
<param name="x">The x-coordinate of the origin of the text being drawn</param>
<param name="y">The y-coordinate of the origin of the text being drawn</param>
<param name="paint">The paint used to draw the text.</param>
<summary>Draws text encoded in a UTF-8 buffer on the canvas.</summary>
<remarks>
<para>Draws the <paramref name="text" />, with origin at (<paramref name="x" />,<paramref name="y" />), using the specified <paramref name="paint" />. The origin is interpreted based on the Align setting in the paint.</para>
<para></para>
<para>The <paramref name="buffer" /> parameter is a pointer to a region in memory that contains a UTF-8 encoded block of text.   This only consumes up to <paramref name="length" /> bytes from the buffer.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="DrawText">
<MemberSignature Language="C#" Value="public void DrawText (string text, SkiaSharp.SKPath path, float hOffset, float vOffset, SkiaSharp.SKPaint paint);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DrawText(string text, class SkiaSharp.SKPath path, float32 hOffset, float32 vOffset, class SkiaSharp.SKPaint paint) cil managed" />
@ -690,6 +736,38 @@
</remarks>
</Docs>
</Member>
<Member MemberName="DrawText">
<MemberSignature Language="C#" Value="public void DrawText (IntPtr buffer, int length, SkiaSharp.SKPath path, float hOffset, float vOffset, SkiaSharp.SKPaint paint);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DrawText(native int buffer, int32 length, class SkiaSharp.SKPath path, float32 hOffset, float32 vOffset, class SkiaSharp.SKPaint paint) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.IntPtr" />
<Parameter Name="length" Type="System.Int32" />
<Parameter Name="path" Type="SkiaSharp.SKPath" />
<Parameter Name="hOffset" Type="System.Single" />
<Parameter Name="vOffset" Type="System.Single" />
<Parameter Name="paint" Type="SkiaSharp.SKPaint" />
</Parameters>
<Docs>
<param name="buffer">Contains a pointer to a region holding UTF-8 encoded text to draw.</param>
<param name="length">Number of bytes to read from the <paramref name="buffer." /></param>
<param name="path">The path the text should follow for its baseline.</param>
<param name="hOffset">The distance along the path to add to the texts starting position.</param>
<param name="vOffset">The distance above(-) or below(+) the path to position the text.</param>
<param name="paint">The paint used to draw the text.</param>
<summary>Draws text encoded in a UTF-8 buffer on the canvas following a bezier path.</summary>
<remarks>
<para>Draw the <paramref name="text" />, using the specified <paramref name="paint" />, along the specified <paramref name="path" />. The paint's Align setting determins where along the path to start the text.</para>
<para>The <paramref name="buffer" /> parameter is a pointer to a region in memory that contains a UTF-8 encoded block of text.   This only consumes up to <paramref name="length" /> bytes from the buffer.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="ResetMatrix">
<MemberSignature Language="C#" Value="public void ResetMatrix ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ResetMatrix() cil managed" />
@ -723,8 +801,7 @@
<summary>Restore the canvas state.</summary>
<remarks>
<para>This call balances a previous call to <see cref="M:SkiaSharp.SKCanvas.Save" />, and is used to remove all modifications to the matrix, clip and draw filter state since the last Save call.</para>
<para>
</para>
<para></para>
<para>It is an error to call Restore() more times than Save() was called.</para>
</remarks>
</Docs>
@ -769,8 +846,7 @@
<param name="degrees">The number of degrees to rotate.</param>
<summary>Preconcat the current matrix with the specified rotation.</summary>
<remarks>
<para>
</para>
<para></para>
</remarks>
</Docs>
</Member>
@ -791,8 +867,7 @@
<param name="radians">The number of radiants to rotate.</param>
<summary>Preconcat the current matrix with the specified rotation.</summary>
<remarks>
<para>
</para>
<para></para>
</remarks>
</Docs>
</Member>
@ -832,8 +907,7 @@
<para>This will equal the number of Save calls minus Retore calls + 1. The save count on a new canvas is 1.</para>
</value>
<remarks>
<para>
</para>
<para></para>
</remarks>
</Docs>
</Member>

Просмотреть файл

@ -49,7 +49,7 @@
<summary>Measure the text, stopping early if the measured width exceeds <paramref name="maxWidth" />.</summary>
<returns>Return the number of characters of text that were measured. </returns>
<remarks>
<para />
<para></para>
</remarks>
</Docs>
</Member>
@ -72,22 +72,45 @@
<param name="text">The text to be measured</param>
<param name="maxWidth">
<para>Maximum width. Only the subset of text whose accumulated widths are &lt;= <paramref name="maxWidth" /> are measured.</para>
<para>
</para>
<para></para>
</param>
<param name="measuredWidth">Returns the actual width of the measured text</param>
<summary>
<para>Measure the text, stopping early if the measured width exceeds <paramref name="maxWidth" />.</para>
<para>
</para>
<para></para>
</summary>
<returns>Return the number of characters of text that were measured. </returns>
<remarks>
<para>
</para>
<para></para>
</remarks>
</Docs>
</Member>
<Member MemberName="BreakText">
<MemberSignature Language="C#" Value="public long BreakText (IntPtr buffer, IntPtr length, float maxWidth, out float measuredWidth);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance int64 BreakText(native int buffer, native int length, float32 maxWidth, float32 measuredWidth) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int64</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.IntPtr" />
<Parameter Name="length" Type="System.IntPtr" />
<Parameter Name="maxWidth" Type="System.Single" />
<Parameter Name="measuredWidth" Type="System.Single&amp;" RefType="out" />
</Parameters>
<Docs>
<param name="buffer">Contains a pointer to a region holding text encoded using the encoding specified in <see cref="P:SkiaSharp.SKPaint.TextEncoding" /> format.</param>
<param name="length">Number of bytes to read from the <paramref name="buffer." /></param>
<param name="maxWidth">Maximum width. Only the subset of text whose accumulated widths are &lt;= <paramref name="maxWidth" /> are measured.</param>
<param name="measuredWidth">Returns the actual width of the measured text</param>
<summary>Measure the text encoded as a UTF-8 buffer, stopping early if the measured width exceeds <paramref name="maxWidth" />.</summary>
<returns>Return the number of characters of text that were measured. </returns>
<remarks>The <paramref name="buffer" /> parameter is a pointer to a region in memory that contains text encoded in the <see cref="P:SkiaSharp.SKPaint.TextEncoding" /> format.   This only consumes up to <paramref name="length" /> bytes from the buffer.</remarks>
</Docs>
</Member>
<Member MemberName="Color">
<MemberSignature Language="C#" Value="public SkiaSharp.SKColor Color { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype SkiaSharp.SKColor Color" />
@ -101,7 +124,7 @@
<Docs>
<summary>The paints color.</summary>
<value>
<para />
<para></para>
</value>
<remarks>
<para>Note that the color is a 32bit value containing alpha as well as r,g,b. This 32bit value is not premultiplied, meaning that its alpha can be any value, regardless of the values of r,g,b.</para>
@ -229,6 +252,28 @@
</remarks>
</Docs>
</Member>
<Member MemberName="MeasureText">
<MemberSignature Language="C#" Value="public float MeasureText (IntPtr buffer, IntPtr length);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance float32 MeasureText(native int buffer, native int length) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.IntPtr" />
<Parameter Name="length" Type="System.IntPtr" />
</Parameters>
<Docs>
<param name="buffer">Contains a pointer to a region holding text encoded using the encoding specified in <see cref="P:SkiaSharp.SKPaint.TextEncoding" /> format.</param>
<param name="length">Number of bytes to read from the <paramref name="buffer." /></param>
<summary>Measures the UTF-8 encoded text.</summary>
<returns>Returns the width of the text.</returns>
<remarks>The <paramref name="buffer" /> parameter is a pointer to a region in memory that contains text encoded in the <see cref="P:SkiaSharp.SKPaint.TextEncoding" /> format.   This only consumes up to <paramref name="length" /> bytes from the buffer.</remarks>
</Docs>
</Member>
<Member MemberName="MeasureText">
<MemberSignature Language="C#" Value="public float MeasureText (string text, ref SkiaSharp.SKRect bounds);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance float32 MeasureText(string text, valuetype SkiaSharp.SKRect bounds) cil managed" />
@ -251,6 +296,33 @@
<remarks>This will return the vertical measure if this is vertical text, in which case the returned value should be treated has a height instead of a width.</remarks>
</Docs>
</Member>
<Member MemberName="MeasureText">
<MemberSignature Language="C#" Value="public float MeasureText (IntPtr buffer, IntPtr length, ref SkiaSharp.SKRect bounds);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance float32 MeasureText(native int buffer, native int length, valuetype SkiaSharp.SKRect bounds) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="buffer" Type="System.IntPtr" />
<Parameter Name="length" Type="System.IntPtr" />
<Parameter Name="bounds" Type="SkiaSharp.SKRect&amp;" RefType="ref" />
</Parameters>
<Docs>
<param name="buffer">Contains a pointer to a region holding text encoded using the encoding specified in <see cref="P:SkiaSharp.SKPaint.TextEncoding" /> format.</param>
<param name="length">Number of bytes to read from the <paramref name="buffer." /></param>
<param name="bounds">Returns the bounds of the text relative to (0,0)</param>
<summary>Measures the UTF-8 encoded text.</summary>
<returns>Returns the width of the text.</returns>
<remarks>
<para>This will return the vertical measure if this is vertical text, in which case the returned value should be treated has a height instead of a width.</para>
<para>The <paramref name="buffer" /> parameter is a pointer to a region in memory that contains text encoded in the <see cref="P:SkiaSharp.SKPaint.TextEncoding" /> format.   This only consumes up to <paramref name="length" /> bytes from the buffer.</para>
</remarks>
</Docs>
</Member>
<Member MemberName="Shader">
<MemberSignature Language="C#" Value="public SkiaSharp.SKShader Shader { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class SkiaSharp.SKShader Shader" />
@ -364,9 +436,9 @@
<ReturnType>SkiaSharp.SKTextEncoding</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>The encoding used by the text.</summary>
<value>The encoding used by the various text measuring primitives.</value>
<remarks>This defaults to UTF8 encoding.</remarks>
</Docs>
</Member>
<Member MemberName="TextScaleX">

Просмотреть файл

@ -35,9 +35,6 @@
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName="")</AttributeName>
</Attribute>
</Attributes>
</Assembly>
</Assemblies>

6
docs/en/ns-.xml Normal file
Просмотреть файл

@ -0,0 +1,6 @@
<Namespace Name="">
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Namespace>