0

A project I am working on needs to be resized when the monitor resolution changes. Due to legacy code and other issues, we do it by using a custom library which scales all the components to the appropriate sizes when the resolution changes.

However, when we scale some of the images/icons used in the project, they become blurry/fuzzy/aliased. Mostly because they are all raster gifs.

One solution we thought might work to mitigate this issue is to either use Vector images and convert them into raster images on the fly (and cache them for performance improvements).

What do you all think? Would this be a good way to go? Or are there better alternatives to my chosen method?

If this is a better way, then can someone give pointers to how to go about the svg conversion to say jpg or png(preferably). Available (and commercially usable) libraries?

Thanks

4

3 回答 3

2

The algo's in java are pretty good. The fundamental problem sounds as if your original images/icons are already too small so scaling them up leaves you with artefacts. A real simple approach is to have the images sent along with the app to be at the larger size and only scale down. I would say a policy on images sizes (pixels height and width) is necessary as you seem to indicate that only some have problems.

Of course if you can go for vector graphics, you can scale infinitely and this may be a better long term investments depending upon your application and the likely hood of needing to support large output formats (not just screens but printing). It may well be fairly complex to approach things this way. (More information would be needed to help you further with the points in this para.)

于 2009-04-05T07:34:43.697 回答
0

Batik can convert svgs into pngs or jpegs

于 2009-04-05T07:25:44.137 回答
0

Metal(跨平台)PL&F 中的图标被绘制成一个缓冲图像,以便与它碰巧发现自己运行的任何机器融为一体。这是一种快速的技术,不会添加依赖项,也不需要学习任何额外的 API(或语言!)。src.zip在您的 Sun JDK 中查看。

于 2009-04-05T12:25:01.533 回答