Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Cannot save image without data loss
Cannot save image without data loss [message #467653] Thu, 02 February 2006 22:05 Go to next message
Eclipse UserFriend
[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 07:58 Go to previous message
Eclipse UserFriend
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)
Previous Topic:"Console" widget using pure SWT?
Next Topic:Which widget ?
Goto Forum:
  


Current Time: Wed Jul 23 16:19:17 EDT 2025

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

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

Back to the top