简体   繁体   中英

How to export high resolution image in Java

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM