Shoutbox

ImageElement + Internet - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: ImageElement + Internet (/showthread.php?tid=70165)

ImageElement + Internet by LifelesS on 01-01-2007 at 09:08 PM

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:D


RE: ImageElement + Internet by Spunky on 01-01-2007 at 09:14 PM

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 :s
RE: ImageElement + Internet by LifelesS on 01-01-2007 at 09:22 PM

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
RE: ImageElement + Internet by Spunky on 01-01-2007 at 09:23 PM

I noticed that, but a URL is still a path to file, just a remote file rather than a local file


RE: ImageElement + Internet by Ezra on 01-01-2007 at 09:26 PM

Otherwise, if that won't work you can always download the file first with the script...


RE: RE: ImageElement + Internet by LifelesS on 01-01-2007 at 09:41 PM

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?
RE: ImageElement + Internet by matty on 01-01-2007 at 10:36 PM

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);
}

RE: ImageElement + Internet by LifelesS on 01-01-2007 at 10:42 PM

Thanks