Re: highlighting word in JPEG image



Dear Chris,

Thanks a lot for your postings! You're right: I changed my code to draw the image before setting the AlphaComposite and I removed the clearRect() line; now the colors look fine.

Your code to find out the resolution of the JPEG looks interesting. I did not yet really try it, but it might be useful later on.

About my assumption that Java works in 72 dpi, I got that from an article on http://java.sun.com/developer/technicalArticles/GUI/java2d/java2dpart1.html
As I understand it now, this applies to the user space, where I thought my program was working, but apperently not. Never mind, as long as it works :-)


Again, thank you for your help!
Best regards,
Marian

Chris Smith wrote:
Marian Hellema <lujanp@xxxxxxxxxx> wrote:

- The version I post below has a color problem. I fiddled with the
AlphaComposite value, but  the original JPEG is either too dark or too
pale compared to the orginal.


Have you tried drawing the original JPEG before setting an AlphaComposite? You should only need to perform alpha-compositing for the highlight, not the original image.


.