e580. stroking or filling with a texture.txt
来自「这里面包含了一百多个JAVA源文件」· 文本 代码 · 共 14 行
TXT
14 行
The buffered image used to create the TexturePaint object is scaled down/up to width w and height h. Conceptually, the scaled down/up buffered image is first painted at (x, y) in user space, and then replicated around it.
// See e575 The Quintessential Drawing Program
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
int x = 10;
int y = 10;
int width = 50;
int height = 25;
TexturePaint texture = new TexturePaint(bufferedImage, new Rectangle(x, y, width, height));
g2d.setPaint(texture);
// Draw shapes...; see e586 Drawing Simple Shapes
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?