作者serveto ( )
看板java
标题[问题] 关於画椭圆fillOval
时间Sun Oct 10 09:32:03 2010
林邦杰"如何设计Java程式"书上是
fillOval(int x, int y, int width, int height)
其中(x,y)是中心座标
但是官网
http://download.oracle.com/javase/7/docs/api/java/awt/Graphics.html
上面的(x,y)则是
"x - the x coordinate of the upper left corner of the oval to be filled.
y - the y coordinate of the upper left corner of the oval to be filled."
怎麽会不依样?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.44.140.54
1F:→ james732:做做实验就知道哪个是对的罗? 10/10 09:48
2F:→ serveto:我关心的是演算法。为何先前版本用的是圆心 10/10 09:51
4F:→ tkcn:只是书上写错了 10/10 12:21
5F:推 stupid0319:请想像一下在长方型中划一个圆 10/10 12:44
6F:推 keeperkai:官网讲得比较正确 因为rec可以接受<0的height width 10/10 21:26
7F:→ keeperkai:但oval不能 一定要用左上的座标 反正就是方框内画椭圆 10/10 21:28