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)是矩形的左上角的坐标

解决方案 »

  1.   

    楼上的太不厚道了,那段时间CSDN清理论坛,我不知道这个,然后被无辜扣了
    很多人都被扣了
      

  2.   

    请问kissyou521(sadf) ,能有相关资料证明吗?
    我也只是怀疑,但是网上好像没有这么说的
      

  3.   

    public void drawRect(int x,
                         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