문제

Is it possible to use as parameters float instead of int for the Rectangle class in c#?! Or any way in which I can do this by creating maybe a new class similar to Rectangle that takes as parameters float?

I am trying to use this within the e.Graphics.DrawEllipse.

Example :

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

Instead of 10,20,30,40 I would like to use floats.

Any help appreciated. Thanks.

도움이 되었습니까?

해결책

There is the RectangleF class in System.Drawing which takes single-precision floating point numbers as parameters:

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top