load an image [message #236541] |
Wed, 04 July 2007 09:30 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.44821 seconds