Posted by demonduck
on October 12, 2008 at 3:25 PM PDT
How do you read a jpg image into a BufferedImage.TYPE_INT_ARGB_PRE?
I've been trying all day and as far as I can tell, reading a jpg image into a
BufferedImage.TYPE_INT_ARGB_PRE is impossible and that can't be right.
It should be less than 10 lines of code. I would really appreciate it if someone could post
a snippet showing how that's done.
The closest I can come to it is a BufferedImage.TYPE_INT_RGB and then I have to translate
it into an int array OR'ing it with 0xff000000. So for an instant, I use twice as much
memory and that can cause my applet to suffer an OutOfMemoryError on some systems.
If I could read the image directly into a premultiplied int array, that would be a big help
to the robustness of the applet.