|Re: Snippet194 throws under linux [message #467411 is a reply to message #467391]
||Tue, 31 January 2006 05:04
| Jason Grant
Registered: July 2009
I started to write a comment in the bug you mentioned, but aborted because
my issue is not with the functionality of the encoders, but rather with
the inability to use o.e.s.g.Image to *paint* in 4-bits (in a portable
I have a need to do what Snippet194 is doing; I just want to generate a
4-bit-indexed image, and save it as 4-bit-indexed. Alas, even though I
construct an Image with my 4-bit-indexed ImageData, myImage.getImageData()
gives me back a 24-bit-direct one. If it would instead give me back a
4-bit-indexed ImageData, then I could save it OK with the existing encoder
functionality, which already supports 4-bit gifs.
I thought about blitting the 24-bit data back to 4 bits for cases where
Image doesn't return 4-bit ImageData, before realising that the blit
methods aren't public. So now I'm just not using SWT to do this - I don't
like it, but I've gone back to Java2D for now, since it's portable.
Hope this makes sense - in short, I cannot *paint* a 4-bit image under
1) I'd really rather paint using SWT, draw2d, etc. instead of awt; is
there a workaround that will allow me to draw on a GC, then get the result
2) Do you think this merits a new bug?
On Mon, 30 Jan 2006 15:49:08 -0500, Carolyn MacLeod wrote:
> Hi, Jason.
> There is already a bug open for this:
> Please add yourself as a cc to this bug to track progress. Feel free to
> mention Snippet194 in the bug as a good example of why this feature is
> "Jason Grant" <firstname.lastname@example.org> wrote in message
>> [Eclipse 3.2M3, gtk]
>> Snippet194 (write an animated gif) throws with message "Unsupported
>> color depth" under linux.
>> This is because the return value from Image.getImageData() is always
>> 24-bit-direct, since Image.init() blits the 4-bit indexed data into
>> 24-bit direct data.
>> 1) Should I register this as a bug?
>> 2) To save a 4-bit-indexed gif under linux, should I blit the output
>> from Image.getImageData() back to 4 bits, then give this to
>> ImageLoader? Or is there a cleaner and more portable way?
>> PS: I encountered this same fault as posted to this list on 27th June
>> 2005 with an earlier edition of Eclipse & SWT. Post subject was
>> "Saving an Image to GIF".
Powered by FUDForum
. Page generated in 0.01843 seconds