|1. image on a button; 2. SVG support in RAP? [message #46661]
||Wed, 12 September 2007 14:25
Originally posted by: s5824917.inf.tu-dresden.de|
I got a little RAP-HelloWorld application to run. Now I am trying to set an
image on a button.
I tried the following:
Image img = org.eclipse.rwt.graphics.Graphics.getImage("info.gif");
but the image doesn't show up, actually I get
"Unable to create view: Argument not valid
Image 'info.gif' cannot be found"
So the image can not be found, but I read the InputStream that is being used
here searches the classpath...
"Note: This method searchs the classpath of the current web-application"
InputStream getResourceAsStream( String name );
Structure and position of the image: (so you can see where I put the
/ src / org.eclipse.rap.hellworld
Can someone help a newbie like me to get this to work?
Is it possible to use other objects inside the views too, like SVG or
So that I could build two views in a perspective, one view with the
SVG-image and one
with options to manipulate said SVG-image.
how hard would it be to accomplish that?
|Re: 1. image on a button; 2. SVG support in RAP? [message #48782 is a reply to message #48666]
||Fri, 21 September 2007 14:53
Originally posted by: jkrause.innoopract.com|
It is just those two lines of code, you don't need to know anything
ClassLoader imageLoader = getClass().getClassLoader();
Image image1 = Graphics.getImage( "icons/info.gif", imageLoader );
And you need to put the image either on the source path, or, like in
this example in the icons folder of the plugin.
Ingo Kaulbach wrote:
> Is there an other, easier, way to load the Image?
> I am not familar with the ClassLoader-Stuff...
Powered by FUDForum
. Page generated in 0.02302 seconds