Stroking or Filling with a Texture 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. TexturePaint texture = new TexturePaint( bufferedImage, new Rectangle(x, y, 50/*w*/, 25/*h*/)); g2d.setPaint(texture); drawShape(g2d);