Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Icons with multiple images
Icons with multiple images [message #441649] Wed, 18 August 2004 18:48 Go to next message
Aaron Mondelblatt is currently offline Aaron MondelblattFriend
Messages: 14
Registered: July 2009
Junior Member
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 19:37 Go to previous messageGo to next message
Aaron Mondelblatt is currently offline Aaron MondelblattFriend
Messages: 14
Registered: July 2009
Junior Member
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 12:41 Go to previous messageGo to next message
Geoffrey Ritchey is currently offline Geoffrey RitcheyFriend
Messages: 42
Registered: July 2009
Member
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 14:53 Go to previous message
Aaron Mondelblatt is currently offline Aaron MondelblattFriend
Messages: 14
Registered: July 2009
Junior Member
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: Tue Apr 23 08:38:11 GMT 2024

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

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

Back to the top