4

是否可以在 c# 中将 Rectangle 类用作参数 float 而不是 int?!或者我可以通过创建一个类似于 Rectangle 作为参数浮动的新类来做到这一点的任何方式?

我正在尝试在e.Graphics.DrawEllipse.

例子 :

e.Graphics.DrawEllipse(new Pen(Brushes.Black, stroke), new Rectangle(10,20,30,40);

我想使用浮点数而不是 10,20,30,40。

任何帮助表示赞赏。谢谢。

4

1 回答 1

11

有一个将数字作为参数的RectangleF类:System.Drawingsingle-precision floating point

http://msdn.microsoft.com/EN-US/library/kwafa1d7(v=VS.110,d=hv.2).aspx

于 2013-07-24T13:40:33.513 回答