0

Widget fetching images from a web server

Hi,

My widgets can show an static web image like this:

"http://www.aserver.com/aimage.jpg"

A simple way to do it is the following code:

CODEBOX
var myImage = new KONtx.element.Image({
src: "http:\\www.aserver.com\aimage.jpg",
}).appendTo(this);


That's right, It works OK with static web images.

Now, my problem:

I want to show dinamic images returned from a web server, like this one that returns a jpg file:

"http://www.aserver.com/createimagejpg?data=value"

I supose I need to use a request/response and a code like this one:

CODEBOX
var myURL = new URL;
myURL.location = "http://www.aserver.com/createimagejpg?data=value";
myURL.fetch();


But now, how can i save the jpg image to a file or asign it directly to a Image element?

Page 353 of the YWE_Developer_Guide.pdf made a short reference to the URL outputFile atribute, but I cant find it.

Thanks a lot

Raul (Spain)
-----

by
5 Replies
  • Have you tried calling the setSource method on the image, and passing in the dynamic string?

    CODE
    myImage.setSource("http://www.aserver.com/createimagejpg?data=" + value);
    0
  • What Steve said... :)-Jeremy
    0
  • Hello All,

    I want to know how to fetch web page on full screen yahoo tv widget. Please send the code.
    0
  • QUOTE (sushma_s_s @ Feb 3 2010, 08:08 PM) <{POST_SNAPBACK}>
    Hello All,

    I want to know how to fetch web page on full screen yahoo tv widget. Please send the code.

    You can fetch using either the URL object, or XMLHTTPRequest like you would in any other AJAX style application. If your trying to display html on the widget though, realize that there is no built in way to do this. A widget is not a webpage, and various html elements that work in a web page, do not translate well to TV.
    0
  • Hi,

    Calling the setSource method on the image, and passing in the dynamic string works for me very well.

    Thanks a lot to Steve and Jeremy

    Work hard.

    Raul
    -----
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets