本文整理匯總了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 ();
}
}