|
|
|
|
|
|
|
|
|
|
Re: image + war [message #135442 is a reply to message #135405] |
Mon, 08 June 2009 10:49 |
|
Hi Kristin,
> I tried to set my image on the browser as backgroundImage and then it
> works fine. Which control can I use to set an image?
Not sure whether I understand this question correctly. You can set an
image on any control that supports setBackgroundImage().
> Or, how can I set a
> backgroundImage once, so that the backgroundImage wouldn't repeat?
Preventing a backgroundImage from repeating is not possible. See the
Javadoc of setBackgroundImage:
"The background image is tiled to fill the available space."
Ralf
|
|
|
Re: image + war [message #135455 is a reply to message #134971] |
Mon, 08 June 2009 10:53 |
|
Hi Kristin,
> I diplay my image in a browser. Here is the code snippet how I get the
> image of the imageData and set the image in the browser control.
> imageName = "/icons/test"+Math.random()+".gif";
> Image image = Graphics.getImage(imageName, new
> ByteArrayInputStream(imageData));
> browser.setText("<img src=\""+imageName+"/>");
I think the advise that Ivan gave you is absolutely right. Even though
an absolute path like /icons/... is appropriate for Graphics
#getImage(), you can not use it directly in your html code - it will
work from Eclipse but not in a deployment. Try this instead:
imageName = "icons/test" + Math.random() + ".gif";
Image image = Graphics.getImage( "/" + imageName, ...
browser.setText( "<img src=\"" + imageName + "/>" );
Ralf
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04470 seconds