Loading ICO images [message #512906] |
Mon, 08 February 2010 05:30  |
Eclipse User |
|
|
|
Hi,
I am writing a RAP application and have a problem loading some ICO images. Unfortunately converting them to PNG or anything else does not seem to be an option.
Basically the following code in a RAP application:
String imgNam = ...
byte[] icoDat = ...
...
Graphics.getImage( imgNam, new ByteArrayInputStream( icoDat ) );
throws the Exception:
java.lang.IllegalArgumentException: Empty region!
at javax.imageio.ImageReader.computeRegions(Unknown Source)
at com.sun.imageio.plugins.wbmp.WBMPImageReader.read(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
Loading the images in an SWT application with:
new Image(display, new ByteArrayInputStream( icoDat ) );
works just fine. I tried the same code in RAP but got the aforementioned exception.
Is the wrong JAI plug-in being picked here ? I guess that the ICO images are really partially corrupt, but they are still loaded by a legacy application and the SWT application, so I would like to be able to do the same in RAP.
I would be grateful for any help.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04151 seconds