Skip to main content



      Home
Home » Newcomers » Newcomers » Images from web in Eclipse
Images from web in Eclipse [message #264588] Mon, 22 September 2008 10:42 Go to next message
Eclipse UserFriend
Hello there,

Currently I'm busy playing around with eclipse and there is a litle thing
that does not work yet. I have an image. (lets say
http://www.jvw.nl/images/eclipse.jpg ) and I want to show it in a eclipse
application. I read it from the web with an input stream but the image is
not shown. There are no errors reported whatsoever.

Does anyone know how to accomplish this?
Re: Images from web in Eclipse [message #264604 is a reply to message #264588] Mon, 22 September 2008 14:01 Go to previous messageGo to next message
Eclipse UserFriend
Can you show us what you did to show the image? i.e. show us some code :-)

Wayne

jjtb somhorst wrote:
> Hello there,
>
> Currently I'm busy playing around with eclipse and there is a litle
> thing that does not work yet. I have an image. (lets say
> http://www.jvw.nl/images/eclipse.jpg ) and I want to show it in a
> eclipse application. I read it from the web with an input stream but the
> image is not shown. There are no errors reported whatsoever.
> Does anyone know how to accomplish this?
Re: Images from web in Eclipse [message #264652 is a reply to message #264604] Tue, 23 September 2008 05:54 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

here is some code I use to create the image:

I've got an Object which generates an url string, creates an get method
for the apache httpclient and finally does the following:

InputStream in = getImage.getResponseBodyAsStream();
return this.loader.load(in)[0];

As you can see here I return the ImageData that was generated from the
InputStream. Tests with a filewriter object (plain old java) showed me
that the image that I write to the disk using this getresponsebodyasstream
was a valid image.

In the code that is using the return value I do the following:

ImageData data = this.gm.generateMap() // method wich returns the
imagedata shown above

Image img = new Image(this.map.getShell().getDisplay(),data);
this.map.setImage(img);

the this.map is a Label instance.
Even when I do a map.getShell.redraw the image is not shown.
Re: Images from web in Eclipse [message #264696 is a reply to message #264652] Wed, 24 September 2008 06:19 Go to previous message
Eclipse UserFriend
When I set the image as background for the Label it does work now.
Previous Topic:Forced line-wrapping in Eclipse editor
Next Topic:Very slow refreshing of TableViewer
Goto Forum:
  


Current Time: Tue Jul 22 01:56:36 EDT 2025

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

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

Back to the top