首页 > 其他 > 详细

graphics.drawRect()方法

时间:2015-01-13 22:50:54      阅读:528      评论:0      收藏:0      [点我收藏+]

drawRect方法的官方API文档描述

drawRect
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 contexts current color.
Parameters:
x - the x coordinate of the rectangle to be drawn.
y - the y coordinate of the rectangle to be drawn.
width - the width of the rectangle to be drawn.
height - the height of the rectangle to be drawn.

width和height的描述是错误的。

实践告诉我们,width,height参数应该是右下角的点的坐标。

graphics.drawRect()方法

原文:http://www.cnblogs.com/zempty/p/4222555.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!