Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Using PNG with Alpha channel in SWT Widgets
Using PNG with Alpha channel in SWT Widgets [message #446617] Mon, 29 November 2004 16:50 Go to next message
Eclipse UserFriend
Originally posted by: vinodhd.gmail.com

Hi,
I am trying to display PNG icons with alpha channel on my swt.Tree widget.
The code looks something like this:

<snip>
adminItem = new TreeItem(adminTree, 0);
adminItem.setText("Administration");
icon = new Image(PlatformUI.getWorkbench().getDisplay(),
Platform.getLocation().toString()+"/Icons/server.png");
adminItem.setImage(icon);
icon.dispose();
</snip>

Now when I ran this, I saw that the alpha channel was not used at all and I
got a black background. I tried converting the PNG to Windows ICON .ico
file and I got the transparency but it was a little jagged. The ICON was in
Windows XP style icon with 8 bit alpha channel. I think the alpha channel
was reduced to one bit.

Is it possible to load a PNG with alpha channel and use it in widgets like
Tree? If I set the TransparentPixel it works, but then without the alpha
channel I lose the visual excellence of the images.

I was wondering how eclipse uses Images in it's IDE. Can someone give me
some pointers to proceed with?

Thankee Sais

- Vinny
Re: Using PNG with Alpha channel in SWT Widgets [message #446680 is a reply to message #446617] Tue, 30 November 2004 15:04 Go to previous messageGo to next message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Hi,

There has been recent work on this. Switch to last week's integration build
of SWT (>= v3113) or today's one. See the two comments starting from:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=35040#c21
(Tree also benefits from the change)

Happy alpha blending,

Chris
Re: Using PNG with Alpha channel in SWT Widgets [message #446683 is a reply to message #446680] Tue, 30 November 2004 15:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vinodhd.gmail.com

Thanks,

Can I use the eclipse-SDK-3.1M3 build of the entire SDK, or can I just
update SWT alone on my current 3.0.1 setup?

Greetings

- Vinny

Christophe Cornu wrote:

> Hi,
>
> There has been recent work on this. Switch to last week's integration
> build of SWT (>= v3113) or today's one. See the two comments starting
> from: https://bugs.eclipse.org/bugs/show_bug.cgi?id=35040#c21
> (Tree also benefits from the change)
>
> Happy alpha blending,
>
> Chris
Re: Using PNG with Alpha channel in SWT Widgets [message #446804 is a reply to message #446683] Thu, 02 December 2004 15:30 Go to previous message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
It's probably easier to just switch to the most recent integration build or
wait for M4 coming up at the end of december. Don't use M3, it's not recent
enough.

Chris
Previous Topic:Listing the running process for an OS...
Next Topic:swt.lib ??
Goto Forum:
  


Current Time: Wed Apr 24 17:01:50 GMT 2024

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

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

Back to the top