码迷,mamicode.com
首页 > 其他好文 > 详细

graphics.drawRect()方法

时间:2015-01-13 22:51:33      阅读:207      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!