首页 > 代码库 > graphics.drawRect()方法
graphics.drawRect()方法
drawRect方法的官方API文档描述
drawRectpublic 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.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()方法
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。