Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » scaling PNG loses transperacy
scaling PNG loses transperacy [message #460992] Tue, 13 September 2005 22:58 Go to next message
Haim is currently offline HaimFriend
Messages: 3
Registered: July 2009
Junior Member
Hi

I'm a java newbie just writing my first program (see http://www.eclipsezone.com/java/forums/m91922511.html) and I have a problem with scaling PNG's (as you can read in the posting above).

I figured how to resize the images:

icon = new Image(display, 24, 24);
GC gc = new GC(icon);
gc.drawImage(iconOrig, 0, 0, iconOrig.getBounds().width, iconOrig.getBounds().height, 0, 0, 24, 24);

where iconOrig is the original image.

the problem is that I loose the transperacy and I get a white background.

is there a way around this?

thanx
--
Haim
Re: scaling PNG loses transperacy [message #461001 is a reply to message #460992] Wed, 14 September 2005 12:37 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
This looks like a bug, or at least unsupported functionality. It might be worth you filing a bug at http://bugs.eclipse.org (free registration required).
Re: scaling PNG loses transperacy [message #461082 is a reply to message #461001] Thu, 15 September 2005 17:16 Go to previous messageGo to next message
Haim is currently offline HaimFriend
Messages: 3
Registered: July 2009
Junior Member
> This looks like a bug, or at least unsupported
> functionality. It might be worth you filing a bug at
> http://bugs.eclipse.org (free registration required).

I opened a bug for it. hope it'll be solved soon.

thanx
--
Haim
Re: scaling PNG loses transperacy - SOLVED [message #461152 is a reply to message #460992] Sat, 17 September 2005 13:58 Go to previous message
Haim is currently offline HaimFriend
Messages: 3
Registered: July 2009
Junior Member
Solved using the second way to scale images:

Image iconOrig = new Image(display, profiles.get(profileName)); // returns the original image
icon = new Image(display, iconOrig.getImageData().scaledTo(22, 22));

Bye
Previous Topic:Setting dynamic Composite size inside a ScrolledComposite
Next Topic:How to re-set shell size
Goto Forum:
  


Current Time: Thu Mar 28 12:12:33 GMT 2024

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

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

Back to the top