mrrearden wrote:
Hello,
I am having a terrible time trying to get this to work and would very much appreciate any help.
I am trying to use xwidget to code my own widget to download a 640x480 gif image every minute or so and display it so I can move it around.
I am using two "image" components #1 I bind to photoalbumcore and set the image source to %FileName. #2 is just an underlay border (to border the chart image from below and make it look nice)
Then I use TimerCore set at a 60000ms update timer with:
function TimerCore1OnUpdate(Sender)
{
DownloadFile("my URL here","achart.gif", "")
}
My problem is that every time I start the widget I get the latest chart but it never updates the image. so I know that the photoalbumcore is passing the image to my "image1" component but it never refreshes.PLEASE HELP ME!!!!

ok heres what i would do...i dont know if the best method but it works for me in a .png case.
Code:
var file = WidgetPath+"achart.gif";
var url = // whatever your url to the .gif is.
function TimerCore1OnUpdate(Sender){
DownloadFile(url,file, "updateGif");
}
function updateGif(){
Gif1.Src = "";
Gif1.Src = file;
}
scrap the photoalbum core and image1 component and use the gif component as qiancang said.
as i said this is what i would do with a .png case im not sure if would work with .gif
i see this post is a bit aged so if u havent already gotten through good luck.