|
|
Re: Image transparency problem - easy, I think - Still need help [message #462750 is a reply to message #462746] |
Tue, 18 October 2005 21:10 |
Mark Victory Messages: 133 Registered: July 2009 |
Senior Member |
|
|
I got it working.
It appears that there is a difference in the ImageData extracted from a
loaded image as opposed
to creating the ImageData from an input stream even if the source .GIF file
is the same.
Thanks,
Mark
"Mark Victory" <mvictory@us.ibm.com> wrote in message
news:dj3f5n$o0u$1@news.eclipse.org...
>I realized that I typed SWT.IMAGE_JPEG rather than SWT.IMAGE_GIF.
> Thought I'd be all set.
>
> However, now I get an error that the "depth is unsupported" on the
> imageSaver.save( ) call. When I debug, the depth is 32. The image is a
> 256 color gif.
>
> Now any ideas?
>
> Thanks,
> Mark
>
> "Mark Victory" <mvictory@us.ibm.com> wrote in message
> news:dj3dqh$m4b$1@news.eclipse.org...
>>I am using a suggestion that someone had on this board for copying an
>>image (.gif) to a new file.
>>
>> Here's the code:
>>
>> private void moveImage(Image image, String fileName)
>> {
>> //New image loader
>> ImageLoader imageSaver = new ImageLoader();
>>
>> //image has been loaded from a .gif fi.e
>> ImageData idata = image.getImageData();
>>
>> //Set the old image data into the loader and
>> imageSaver.data = new ImageData[]{idata};
>>
>> //save as the new image.
>> imageSaver.save(path+File.separator+fileName+".gif",
>> SWT.IMAGE_JPEG);
>> }
>>
>> The problem is that the background of the new image is black rather than
>> transparent.
>> I saw the information about the transparency bit but apparently, I'm not
>> smart enough to understand it. :-)
>>
>> Any help would be appreciated.
>>
>> Thanks,
>> Mark
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04197 seconds