Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » load an image
load an image [message #236541] Wed, 04 July 2007 09:30 Go to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Hi,

I'm looking for the way to load an image as an icon. This image
is not stored under the plugin directory but defined at runtime
by the user.

How can I load this image ?

Thanks

Alexandre
Re: load an image [message #236543 is a reply to message #236541] Wed, 04 July 2007 09:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Solved with the following code

private static Image createImage(String name) {
ImageRegistry imagesR=new ImageRegistry();
try {
URL url = new URL ("file:///" + name);
imagesR.put("test",ImageDescriptor.createFromURL(new
java.net.URL("file:///" + name)));
}
catch (MalformedURLException ex) {

}
return imagesR.get("test");
}
Re: load an image [message #236544 is a reply to message #236543] Wed, 04 July 2007 09:54 Go to previous message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

But when executing I've a strange text who appear with the image

"ResourceSet" from where this text came from ?

thanks
Previous Topic:Map component with Draw2D
Next Topic:Connections outside containers
Goto Forum:
  


Current Time: Sat Aug 13 03:31:39 GMT 2022

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

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

Back to the top