0

I tried to take a snapshot of a JFrame and then export the image. The DPI was only 72dpi, and I would like to know how to increase the resolution.

I followed the link to set DPI of an image, but it does not really export a higher quality image... It seems to only change the meta-data of the image file, not actually increase the quality of the export.

How can I export the image with an actual higher resolution then 72 dpi?

Community
  • 1
  • 1
Nick Ren
  • 65
  • 3
  • 10

1 Answers1

2

The DPI metadata is just guidance as to the 'ideal' printing resolution/size of the image. As you say, it has nothing to do with the actual 'quality' of the image itself.

The snapshot should capture the actual full resolution of the JFrame (how did you capture the snapshot?). That's the maximum resolution that is possible -it's what Java generates and your monitor displays. There isn't anything else!

If the image quality appears poor, check you aren't saving it in a lossy format such as JPEG, though.

DNA
  • 42,007
  • 12
  • 107
  • 146
  • Hi, I'm using Robot.createScreenCapture() to get entire frame... The quality of export image is not bad. I just want to increase the resolution so that when I zoom out to larger size it should still maintain the high quality... – Nick Ren Feb 16 '12 at 14:12
  • You can't zoom a bitmap past 100% and get any more quality - it's the fundamental nature of a bitmap! – DNA Feb 16 '12 at 15:24
  • (OK, there are some ways to cheat with interpolating photos, using fractal techniques, but those don't apply for crisp computer window graphics) – DNA Feb 16 '12 at 15:24