E
Elliot
Hi all,
I'm using the following code to scale a jpg that I've loaded off disk
in a Java application:
int x0 = 0, y0 = 0;
Graphics2D g2d = (Graphics2D)g;
g2d.translate(x0,y0 );
g2d.scale( scaleFactor,scaleFactor );
AffineTransform at = AffineTransform.getTranslateInstance(x0,y0);
BufferedImage bufImage = this.toBufferedImage(this.imgSource);
g2d.drawRenderedImage(bufImage, at);
How can I precisely determine the x, y position as was done with
g.drawImage() from the Graphics package with the above code that I'm
using for scaling? I would think that the translate method needs to
default value but this is the only time I'm displaying the image.
Thanks
Elliot
I'm using the following code to scale a jpg that I've loaded off disk
in a Java application:
int x0 = 0, y0 = 0;
Graphics2D g2d = (Graphics2D)g;
g2d.translate(x0,y0 );
g2d.scale( scaleFactor,scaleFactor );
AffineTransform at = AffineTransform.getTranslateInstance(x0,y0);
BufferedImage bufImage = this.toBufferedImage(this.imgSource);
g2d.drawRenderedImage(bufImage, at);
How can I precisely determine the x, y position as was done with
g.drawImage() from the Graphics package with the above code that I'm
using for scaling? I would think that the translate method needs to
default value but this is the only time I'm displaying the image.
Thanks
Elliot