ImageElement + Internet |
Author: |
Message: |
LifelesS
Full Member
  
Posts: 115 Reputation: 4
32 / / 
Joined: Dec 2006
|
O.P. ImageElement + Internet
Hi everybody
I have a dought about ImageElement. Here's the thing, is it possible to set an image in ImageElement from the internet? Something like a preview window, like photoshop has, but from the internet.
If it is possible, how?
TIA 
Best Regards,
Joćo Godinho
|
|
01-01-2007 09:08 PM |
|
 |
Spunky
Former Super Mod
    

Posts: 3656 Reputation: 61
36 / / 
Joined: Aug 2006
|
RE: ImageElement + Internet
Could you not use
code: PlusWnd.ImageElmt_SetImageFile("imageurl.png")
Not got MP!L at the moment so I can't test it
EDIT: Confused 2 functions 
This post was edited on 01-01-2007 at 09:16 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" 
|
|
01-01-2007 09:14 PM |
|
 |
LifelesS
Full Member
  
Posts: 115 Reputation: 4
32 / / 
Joined: Dec 2006
|
O.P. RE: ImageElement + Internet
Haven't checked it out yet. Going to try it now, but in Script Doc. says:
quote: File
[string] Path to the image's file to use. It can be a PNG, a JPG, a GIF or a BMP file. The path is relative to the script's "Images" sub-directory by default, to override this behavior, prefix the path with "\". Example: "\C:\directory\picture.png".
Don't know if it will work with a URL.
Thanks
Best Regards,
Joćo Godinho
|
|
01-01-2007 09:22 PM |
|
 |
Spunky
Former Super Mod
    

Posts: 3656 Reputation: 61
36 / / 
Joined: Aug 2006
|
RE: ImageElement + Internet
I noticed that, but a URL is still a path to file, just a remote file rather than a local file
<Eljay> "Problems encountered: shit blew up" 
|
|
01-01-2007 09:23 PM |
|
 |
Ezra
Veteran Member
    

Forgiveness is between them and God
Posts: 1960 Reputation: 31
38 / / 
Joined: Mar 2003
|
RE: ImageElement + Internet
Otherwise, if that won't work you can always download the file first with the script...
|
|
01-01-2007 09:26 PM |
|
 |
LifelesS
Full Member
  
Posts: 115 Reputation: 4
32 / / 
Joined: Dec 2006
|
O.P. RE: RE: ImageElement + Internet
Didn't work the way I try it...
quote: Originally posted by SpunkyLoveMuff
Otherwise, if that won't work you can always download the file first with the script...
How?
Best Regards,
Joćo Godinho
|
|
01-01-2007 09:41 PM |
|
 |
matty
Scripting Guru
    
Posts: 8328 Reputation: 109
40 / / 
Joined: Dec 2002
Status: Away
|
RE: ImageElement + Internet
code: function _download(_path){
Interop.Call('urlmon', 'URLDownloadToFileW', 0, _path, _getTempFile(_getTempPath()), 0, 0);
}
function _getTempPath(){
var sBuffer = Interop.Allocate((100+1)*2);
Interop.Call('kernel32', 'GetTempPathW', 100, sBuffer);
return sBuffer.ReadString(0);
}
function getTempFile(_spath){
var sBuffer = Interop.Allocate((260+1)*2);
Interop.Call('kernel32', 'GetTempFileNameW', _spath, 'img', 0, sBuffer);
return sBuffer.ReadString(0);
}
|
|
01-01-2007 10:36 PM |
|
 |
LifelesS
Full Member
  
Posts: 115 Reputation: 4
32 / / 
Joined: Dec 2006
|
O.P. RE: ImageElement + Internet
Thanks
Best Regards,
Joćo Godinho
|
|
01-01-2007 10:42 PM |
|
 |
|