I've been reading about sub-pixel accuracy but could not find a way to do this.
Q: How can I move a BufferedImage
across a Canvas
at non-integer speeds without stuttering?
I can logically understand how the process happens - slight resizing with Anti-Aliasing, but I cannot recreate this in Java. (I've had experience with Flash where such an effect is created by default on most visual objects.)
Note: I've submitted a question about the subject before, but after searching for further information I still couldn't implement what I learned.
If it is not too much trouble, a simple example would be very appreciated.
Thanks in advance.
Edit: This is how I understood the effect can be achieved, though it doesn't work for me:
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.draw(new Rectangle2D.Double(x, y, width, height));
There is no visible change between double and similar int values at the x & y fields, and when I try to create very slow movement (system time based, for example) I see the rectangle doing nothing but moving a single pixel every now and then.