Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » serialize Image
serialize Image [message #459620] Sat, 13 August 2005 10:57 Go to next message
Musachy Barroso is currently offline Musachy BarrosoFriend
Messages: 22
Registered: July 2009
Junior Member
Hi

I'd like to serialize and Image, I already have the image loaded, it
seems like ImageLoader only serilizes the images that it loaded itself.
I tried (altough it seems wrong):

ByteArrayOutputStream outs = new ByteArrayOutputStream();
ImageLoader loader = new ImageLoader()
loader.data = new ImageData[] {image.getImageData()};
loader.save(outs, image.type);

That serializes the image data, but when I read it back the background
(wich is transparent) is black.

Any hint to get me started will do.

thanks

musachy
Re: serialize Image [message #459690 is a reply to message #459620] Sun, 14 August 2005 15:51 Go to previous messageGo to next message
Musachy Barroso is currently offline Musachy BarrosoFriend
Messages: 22
Registered: July 2009
Junior Member
Musachy Barroso wrote:
> Hi
>
> I'd like to serialize and Image, I already have the image loaded, it
> seems like ImageLoader only serilizes the images that it loaded itself.
> I tried (altough it seems wrong):
>
> ByteArrayOutputStream outs = new ByteArrayOutputStream();
> ImageLoader loader = new ImageLoader()
> loader.data = new ImageData[] {image.getImageData()};
> loader.save(outs, image.type);
>
> That serializes the image data, but when I read it back the background
> (wich is transparent) is black.
>
> Any hint to get me started will do.
>
> thanks
>
> musachy

I found out that ImageLoader is using WinBMPFileFormat to load my image,
wich is a PNG, besides that, in PNGFileFormat you can read this:

void unloadIntoByteStream(ImageData p1) {
SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
}

does that mean that I can't serialize/deserialize a PNG image? Oh by the
way I'm using Linux/GTK.

thanks

musachy
Re: serialize Image [message #460377 is a reply to message #459690] Wed, 24 August 2005 13:40 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=24697.

"Musachy Barroso" <musachy@gmail.com> wrote in message
news:ddmf4v$ie7$1@news.eclipse.org...
> Musachy Barroso wrote:
> > Hi
> >
> > I'd like to serialize and Image, I already have the image loaded, it
> > seems like ImageLoader only serilizes the images that it loaded itself.
> > I tried (altough it seems wrong):
> >
> > ByteArrayOutputStream outs = new ByteArrayOutputStream();
> > ImageLoader loader = new ImageLoader()
> > loader.data = new ImageData[] {image.getImageData()};
> > loader.save(outs, image.type);
> >
> > That serializes the image data, but when I read it back the background
> > (wich is transparent) is black.
> >
> > Any hint to get me started will do.
> >
> > thanks
> >
> > musachy
>
> I found out that ImageLoader is using WinBMPFileFormat to load my image,
> wich is a PNG, besides that, in PNGFileFormat you can read this:
>
> void unloadIntoByteStream(ImageData p1) {
> SWT.error(SWT.ERROR_UNSUPPORTED_FORMAT);
> }
>
> does that mean that I can't serialize/deserialize a PNG image? Oh by the
> way I'm using Linux/GTK.
>
> thanks
>
> musachy
Previous Topic:SWT and JWS with HP-UX motif?
Next Topic:Multiline tooltips
Goto Forum:
  


Current Time: Sun Apr 18 22:17:02 GMT 2021

Powered by FUDForum. Page generated in 0.01372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top