看板 java 關於我們 聯絡資訊
林邦傑"如何設計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
james732:做做實驗就知道哪個是對的囉? 10/10 09:48
serveto:我關心的是演算法。為何先前版本用的是圓心 10/10 09:51
serveto:http://tinyurl.com/2vj8nr3 10/10 09:56
tkcn:只是書上寫錯了 10/10 12:21
stupid0319:請想像一下在長方型中劃一個圓 10/10 12:44
keeperkai:官網講得比較正確 因為rec可以接受<0的height width 10/10 21:26
keeperkai:但oval不能 一定要用左上的座標 反正就是方框內畫橢圓 10/10 21:28