Search code examples
javaimagedrawgraphics2d

Drawing images with float coordinates


I want to draw an image that moves slowly with fractional coordinates so the movement is smoother. The image is very small (5x7 pixels). I thought that Graphics2D might have a way to draw an image at a fractional location using anti-aliasing. Any help is appreciated.


Solution

  • Draw the image using an AffineTransform translate instance - it accepts doubles.