Hello Oliver!
> Previously, you said you wanted to display an SVG image within a JFrame.
> Now you're saying you want to convert it to an Image object somehow. Which
> is it that you actually want to do? The solution for each will probably be
> vastly different.
Till now I used JPG images for the Icon of a JFrame, for the Icon of a
JLabel, to display a graphic in a frame, and so on.
But vector graphics are better than pixel graphics, if you want to resize
them without losing quality, and SVG images are the future of vector
graphics. I searched also for a solution for EPS images, but I didn't find
anything.
I know how to display an image in a frame over JSVGCanvas. It's quit
simple, if you know that you have to use JSVGCanvas for this.
But now I want also replace my JPG images with my new SVG images for:
JFrame.setIconImage(Image) and JLabel.setIcon(Image).
Do you knwo how I can do this? Is it possible to create an Image Object
from an SVG image to use it with setIconImage() and setIcon()?
Thanks and kind greetings,
Christian.
Oliver Wong - 12 Jul 2006 21:25 GMT
> Hello Oliver!
>
[quoted text clipped - 24 lines]
> Thanks and kind greetings,
> Christian.
for JFrame.setIconImage(Image), the icon is likely to be no bigger than
128 by 128 pixels on all the OSes that I know of. I believe that on Windows,
it may be as small as 32x32. In this case, use a 128x128 JPG, and you'll be
set for the next 5 years.
For JLabel.setIcon(Image), I recommend you use an AbstractJSVGComponent,
and position it relative to your label using a layout manager.
- Oliver