本文整理汇总了C#中SkiaSharp.SKPaint.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# SKPaint.Dispose方法的具体用法?C# SKPaint.Dispose怎么用?C# SKPaint.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkiaSharp.SKPaint
的用法示例。
在下文中一共展示了SKPaint.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBackgroundImage
public SKImage CreateBackgroundImage ()
{
SKPaint paint = null;
SKPath path = null;
try
{
var height = (int)Bounds.Height;
var width = (int)Bounds.Width;
using (var surface = SKSurface.Create (width, height, SKColorType.N_32, SKAlphaType.Premul))
{
var canvas = surface.Canvas;
//canvas.Clear (SKColors.Beige);
paint = new SKPaint
{
Color = SKColors.DarkBlue,
IsStroke = true,
StrokeWidth = 1,
StrokeCap = SKStrokeCap.Round,
IsAntialias = true
};
//path = new SKPath ();
//path.MoveTo (0f, 0f);
//path.LineTo (width, height);
//path.Close ();
//canvas.DrawPath (path, paint);
//DrawArc (canvas, paint, 0, 90);
var start = -90;
var end = 0;
//DrawCircle (canvas, paint, width / 2, height / 2, width / 2 - 4);
DrawArcFromTo (canvas, paint, width / 2, height / 2, width / 2 - 4, start, end);
DrawArcFromTo (canvas, paint, width / 2, height / 2, (int)((width / 2 - 4) * 0.8), start, end);
return surface.Snapshot ();
}
}
finally
{
if (paint != null)
paint.Dispose ();
if (path != null)
path.Dispose ();
}
}