Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Relative paths when loading images
Relative paths when loading images [message #152310] Tue, 28 September 2004 22:25 Go to next message
Eclipse UserFriend
Originally posted by: noreply.reply.com

I use an image figure with the following code:

Image i = new Image(null, "pics/host.gif");
ImageFigure iFig = new ImageFigure(i);
return iFig;

The problem is that host.gif cannot be found although it exists! If I use a
full path (eg: c:/project/pics/host.gif) the image is created successfuly.

The strange this it that when creating the icon for the model I can use
relative paths:

ImageDescriptor.createFromFile(MyPlugin.class, "pics/host-icon.gif")


What am I doing wrong?
Thanks,
George
Re: Relative paths when loading images [message #152318 is a reply to message #152310] Tue, 28 September 2004 23:11 Go to previous message
Alex Selkov is currently offline Alex SelkovFriend
Messages: 73
Registered: July 2009
Member
In second case you already provided location (in "MyPlugin.class" argument).

In first case you may have something like this:

Image i = new
Image(null,MyPlugin.class.getResourceAsStream("pics/host.gif));

Regards,

as

"George" <noreply@reply.com>
Previous Topic:RectilinearHandleRouter
Next Topic:"Hide" Option in ContextMenu
Goto Forum:
  


Current Time: Thu Apr 25 07:52:15 GMT 2024

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

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

Back to the top