Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Cannot save image without data loss
Cannot save image without data loss [message #467653] Fri, 03 February 2006 03:05 Go to next message
Jason Grant is currently offline Jason GrantFriend
Messages: 77
Registered: July 2009
Member
[Eclipse 3.2M3, gtk]

Does SWT support portable saving of an image in a lossless format?

My problem is that after painting on my GC, I try to save it with:

ImageLoader loader = new ImageLoader();
loader.data = new ImageData[]{myImage.getImageData()};
...
loader.save(outfile, SWT.IMAGE_GIF);

however under linux, the image always returns 24 bit-direct ImageData, and
my only option to save this appears to be as a JPG (i.e. GIF doesn't
support 24-bit, and PNG has no encoder). Unfortunately, the JPG encoder
appears to use a hard-coded quality setting.

Pointers/ideas appreciated.

Jason.
Re: Cannot save image without data loss [message #467667 is a reply to message #467653] Fri, 03 February 2006 12:58 Go to previous message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
Jason Grant write:

Save SWT Image as BMP and pipe output to Jimi (image library from
Sun) that can save PNG and many other formats. May be you can even use
some standard image library in Java.

> [Eclipse 3.2M3, gtk]
>
> Does SWT support portable saving of an image in a lossless format?
>
> My problem is that after painting on my GC, I try to save it with:
>
> ImageLoader loader = new ImageLoader();
> loader.data = new ImageData[]{myImage.getImageData()};
> ...
> loader.save(outfile, SWT.IMAGE_GIF);
>
> however under linux, the image always returns 24 bit-direct ImageData, and
> my only option to save this appears to be as a JPG (i.e. GIF doesn't
> support 24-bit, and PNG has no encoder). Unfortunately, the JPG encoder
> appears to use a hard-coded quality setting.
>
> Pointers/ideas appreciated.
>
> Jason.


--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)


Konstantin Scheglov,
Google, Inc.
Previous Topic:"Console" widget using pure SWT?
Next Topic:Which widget ?
Goto Forum:
  


Current Time: Wed Apr 24 23:12:43 GMT 2024

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

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

Back to the top