Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Icons with multiple images
Icons with multiple images [message #441649] Wed, 18 August 2004 14:48 Go to next message
Eclipse UserFriend
I have an icon that contians the same image but in 16 X 16 format and 32 X
32 format how do I pick the 16 X 16 one.
Re: Icons with multiple images [message #441652 is a reply to message #441649] Wed, 18 August 2004 15:37 Go to previous messageGo to next message
Eclipse UserFriend
that was easy

ImageLoader l = new ImageLoader();
final ImageData d[] = l.load(".//images//" + str.trim());
ImageDescriptor imagedis = new ImageDescriptor()
{
public ImageData getImageData()
{
int len = d.length;
return(d[len-1]);
}
};
this.setImageDescriptor( imagedis );
Re: Icons with multiple images [message #441662 is a reply to message #441652] Thu, 19 August 2004 08:41 Go to previous messageGo to next message
Eclipse UserFriend
Why don't you put the size as part of the name so you don't have to load
the image to tell its the wrong one? e.i cancel_32.jpg, cancel_16.jpg

whatsgoingon wrote:

> that was easy

> ImageLoader l = new ImageLoader();
> final ImageData d[] = l.load(".//images//" + str.trim());
> ImageDescriptor imagedis = new ImageDescriptor()
> {
> public ImageData getImageData()
> {
> int len = d.length;
> return(d[len-1]);
> }
> };
> this.setImageDescriptor( imagedis );
Re: Icons with multiple images [message #441672 is a reply to message #441662] Thu, 19 August 2004 10:53 Go to previous message
Eclipse UserFriend
It it were up to me I would...however life is not that easy. I have a file
called tree.ico It contains the same excact pictures expect for the size
difference...if you open in a program such as liquidicon it will ask you
for which one. Apparently this more usefull for when u have alot of icons
or something. I just want to get the ugly hozintonal lines outta my
toolbar and I will be happy man

later,
whatsgoingon
geoff wrote:

> Why don't you put the size as part of the name so you don't have to load
> the image to tell its the wrong one? e.i cancel_32.jpg, cancel_16.jpg

> whatsgoingon wrote:

> > that was easy

> > ImageLoader l = new ImageLoader();
> > final ImageData d[] = l.load(".//images//" + str.trim());
> > ImageDescriptor imagedis = new ImageDescriptor()
> > {
> > public ImageData getImageData()
> > {
> > int len = d.length;
> > return(d[len-1]);
> > }
> > };
> > this.setImageDescriptor( imagedis );
Previous Topic:swing support on linux
Next Topic:Display.map vs. Control.toControl/Control.toDisplay
Goto Forum:
  


Current Time: Thu Jul 03 06:37:51 EDT 2025

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

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

Back to the top