主题:graphics中cliprect函数怎么用
csea
[专家分:340] 发布于 2008-01-12 22:44:00
看帮助文档说将当前剪贴区与指定的矩形相交。是不是就是说以后只能在相交的区域内绘图?还有这个函数的参数怎么设置呢?[em10]
回复列表 (共2个回复)
沙发
justforfun626 [专家分:18460] 发布于 2008-01-12 23:05:00
[quote]
clearRect
public abstract void clearRect(int x,
int y,
int width,
int height)
Clears the specified rectangle by filling it with the background color of the current drawing surface. This operation does not use the current paint mode.
Beginning with Java 1.1, the background color of offscreen images may be system dependent. Applications should use setColor followed by fillRect to ensure that an offscreen image is cleared to a specific color.
Parameters:
x - the x coordinate of the rectangle to clear.
y - the y coordinate of the rectangle to clear.
width - the width of the rectangle to clear.
height - the height of the rectangle to clear.
[/quote]
Copied from javadoc
板凳
justforfun626 [专家分:18460] 发布于 2008-01-12 23:11:00
Here is an example with picture
[url]http://www.java2s.com/Code/Java/2D-Graphics-GUI/Clipthearea.htm[/url]
我来回复