What I would do is start with a BufferedImage
which will act as the final output.
Create it so it's size is width x scale
and height x scale
.
Obtain a Graphics
context from it using BufferedImage#createGraphics
and set the context's scale accordingly, using Graphics#scale
.
Then paint the output to this Graphics
context, don't forget to call Graphics#dispose
when you're done.
With this BufferedImage
, render this to the screen. This gives you the "zoom" functionality.
For the panning, you can take a look at Java Applet Game 2D Window Scrolling for an example.