Determing x, y positions with g2d.drawRenderedImage
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
.
Relevant Pages
- Scaling more than one object when printing?
... I'm using the following code to scale a jpg that I've loaded off disk ... in a Java application: ... AffineTransform at = AffineTransform.getTranslateInstance; ... BufferedImage bufImage = this.toBufferedImage; ... (comp.lang.java.programmer) - Re: Looking for some design inspiration
... We at GemStone Systems have spent a great deal of time and effort to ... a disk file. ... usually to help avoid using too much heap in the virtual machine... ... but only a portion of the table needs to be in the Java heap ... (comp.databases.theory) - Re: Solaris vs AIX
... Java is not about "easier and faster"; that would, at best, be a function ... You can write garbage in any language. ... the end you're better off using a supported disk than Corpsys ... Even top of the line FC drives arent't that costly. ... (comp.unix.solaris) - Re: Slow Filesystem I/O
... >>under a different name using dd from GNV (in order to eliminate Java ... > One major difference is that on Windows you are writing to cache & then using ... > lazy write to get the contents onto disk. ... While with VMS a write operation - ... (comp.os.vms) - Re: J2SE Runtime Environment 5.0 updates.
... You should uninstall all versions of Java (rebooting after each uninstall) and install the latest version of Java which you can obtain here: ... run the disk cleanup wizard, reduce the allocations for the Recycle Bin, TIF and restore points. ... (microsoft.public.windowsxp.perform_maintain) |
|