Graphics.getImage("path...") -> IllegalArgumentException: Argument not validImage [message #506743] |
Sat, 09 January 2010 11:25 |
Eduard Messages: 29 Registered: September 2009 |
Junior Member |
|
|
Hello RAP-Community?
I am trying to load some images for use in my layout.
I found two ways for loading images:
1. Load images from a plugin
ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginID, pathToImage);
descriptor.createImage();
This works fine. I can create images form other plugins and also from the same plugin in which the code is execuded.
2. Load images within a plugin through Graphics.getImage("images/background.png");
When I try this I get the folloging errror: Quote: | Argument not validImage 'images/background.png' cannot be found.
|
The code is executed from within the plugin where the image resides. The images are also included in the binary build.
Why is the second way for loading images not working? I tried also to put a '/' in front of the imagepath. Unfortuneately no success.
Which way for loading images from the same plugin is prefered?
Best Regards
Eduard Seibel
[Updated on: Sat, 09 January 2010 06:25] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04167 seconds