本文整理汇总了C#中CGPath类的典型用法代码示例。如果您正苦于以下问题:C#CGPath类的具体用法?C#CGPath怎么用?C#CGPath使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:CreatePieSegment
privateUIImageCreatePieSegment(CGSizesize,nfloatendAngle)
{
//Addthearc
vararc=newCGPath();
arc.MoveToPoint(size.Width/2.0f,size.Height/2.0f);
arc.AddLineToPoint(size.Width/2.0f,0);
arc.AddArc(size.Width/2.0f,size.Height/2.0f,size.Width/2.0f,_startAngle,endAngle,false);
arc.AddLineToPoint(size.Width/2.0f,size.Height/2.0f);
//Strokethearc
UIGraphics.BeginImageContextWithOptions(size,false,0);
varcontext=UIGraphics.GetCurrentContext();
context.AddPath(arc);
context.SetFillColor(UIColor.FromRGBA(0f,0f,0f,1f).CGColor);
context.FillPath();
//Getthemaskimage
varimage=UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();
returnimage;
}
原文链接:
http://www.jxszl.com/biancheng/C/556713.html