Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object? 1) The rectangle drawn will have a total width of 5 pixels. 2) The rectangle drawn will have a total height of 6 pixels. 3) The rectangle drawn will have a total width of 10 pixels. 4) The rectangle drawn will have a total height of 11 pixels.
answer:4)
3)为何不对?解释一下
并且为何多出了一个pixel?
不要告诉我超出边界了啊,(5,5)是矩形的左上角的坐标
answer:4)
3)为何不对?解释一下
并且为何多出了一个pixel?
不要告诉我超出边界了啊,(5,5)是矩形的左上角的坐标
很多人都被扣了
我也只是怀疑,但是网上好像没有这么说的
int y,
int width,
int height)
Draws the outline of the specified rectangle. The left and right edges of the rectangle are at x and x + width. The top and bottom edges are at y and y + height. The rectangle is drawn using the graphics context's current color.从帮助文档看
横坐标最左边是在x,最右边是在 x + width,所以加上边的总长是 width+1