XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 11:07 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Using remote images
PostPosted: October 14th, 2013, 5:42 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Trying to use a remote image in an image control... Help needed. Anyone? Tried to use the download file but that didn't work.

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
 Post subject: Re: Using remote images
PostPosted: October 14th, 2013, 10:17 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Could you pls be more clear DG? What exactly do you want to do...?

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
 Post subject: Re: Using remote images
PostPosted: October 15th, 2013, 4:56 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Stuck with that flickr weather one...
I got the url of images from the server (something like : http://example.com/image.jpg). Now i have to download and display them in an image control. But the code for downloading "downloadfile()" is not working. So is there another way of downloading or displaying them?

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
 Post subject: Re: Using remote images
PostPosted: October 15th, 2013, 6:39 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
I see! I didn't realize that was for my request! :lol:
Come on guys help us with this..!

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
 Post subject: Re: Using remote images
PostPosted: October 15th, 2013, 1:16 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
This seems to work, does it help ? (credit to KJags for similar post ;) )

var url = "http://blog.marketing.ai/wp-content/uploads/2013/04/Link.jpg"; // whatever your url is to the image.
var file = WidgetPath+"Link.jpg"; // save location and file name

function button1OnClick(Sender)
{
DownloadFile(url,file, "UpdateImage"); // run function after download
}

function UpdateImage()
{
image1.Src = "";
image1.Src = file; // update the image
}


Top
 Profile  
 
 Post subject: Re: Using remote images
PostPosted: October 16th, 2013, 6:06 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Thanks meme... Looks like it will do the job. But isn't there any way to know whether the file was successfully downloaded?

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
 Post subject: Re: Using remote images
PostPosted: October 16th, 2013, 9:33 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
Quote:
But isn't there any way to know whether the file was successfully downloaded?

Maybe, delete the file with
DeletFilesToRecycle(file,0);

then download the file
DownloadFile(url,file, "UpdateImage");

then in function UpdateImage() (because this seems to execute after the download is complete) check if the file exists with
FileExists(file);

If the file exists the download was successful.


Top
 Profile  
 
 Post subject: Re: Using remote images
PostPosted: October 16th, 2013, 11:41 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Thanks a lot!

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Bing [Bot] and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group