本文整理汇总了C#中System.Drawing.RectangleF.ToEto方法的典型用法代码示例。如果您正苦于以下问题:C# System.Drawing.RectangleF.ToEto方法的具体用法?C# System.Drawing.RectangleF.ToEto怎么用?C# System.Drawing.RectangleF.ToEto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.RectangleF
的用法示例。
在下文中一共展示了System.Drawing.RectangleF.ToEto方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillEllipse
public void FillEllipse(Brush brush, float x, float y, float width, float height)
{
SetOffset(true);
StartDrawing();
/* if (width == 1 || height == 1)
{
DrawLine(color, x, y, x+width-1, y+height-1);
return;
}*/
var rect = new CGRect(x, y, width, height);
Control.AddEllipseInRect(rect);
Control.Clip();
brush.Draw(this, rect.ToEto());
EndDrawing();
}
示例2: FillPie
public void FillPie(Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
{
SetOffset(true);
StartDrawing();
var rect = new CGRect(x, y, width, height);
Control.SaveState();
var yscale = rect.Height / rect.Width;
var centerY = rect.GetMidY();
var centerX = rect.GetMidX();
Control.ConcatCTM(new CGAffineTransform(1.0f, 0, 0, yscale, 0, centerY - centerY * yscale));
Control.MoveTo(centerX, centerY);
Control.AddArc(centerX, centerY, rect.Width / 2, CGConversions.DegreesToRadians(startAngle), CGConversions.DegreesToRadians(startAngle + sweepAngle), sweepAngle < 0);
Control.AddLineToPoint(centerX, centerY);
Control.ClosePath();
Control.RestoreState();
Control.Clip();
brush.Draw(this, rect.ToEto());
EndDrawing();
}
示例3: FillRectangle
public void FillRectangle(Brush brush, float x, float y, float width, float height)
{
SetOffset(true);
StartDrawing();
var rect = new CGRect(x, y, width, height);
Control.AddRect(rect);
Control.Clip();
brush.Draw(this, rect.ToEto());
EndDrawing();
}