ID:817416
 
Keywords: download, image
(See the best response by DarkCampainger.)
I need the ability to download an image to a file and display to the user.

I've worked on this a long, long time ago, got stuck, and haven't worked on it since. I'd like to come back and try to get it working.

What I need is to store the URI of the image into a variable, download the image to a file, and display it in a skin window.

It doesn't strictly have to be done this way, but everything needs to be done at runtime, not pre-compiled. The reason is if I decide to prepackage the images, the size of the bytecode will explode to an unacceptable size. Probably a gigabyte or more.

I remember reading about a mechanism that downloads the resources at runtime, decreasing the size of the bytecode, but it still requires me to go back and manually put in the images. The optimal situation is being able to write the program so when a new subclass is derived from another, all I have to do is give it a new URL and the rest will be taken care of.

Any help or links to tutorials for getting this done will be much appreciated.
I'm looking through the skin reference, and it looks like I can embed images from the web. This will work great for what's needed.

Now I just need to figure out how to output an image to a skin window.
In response to Mardok
Turns out it's as simple as

var/list/params = new
params["enable-http-images"] = "true"
params["image"] = "http://url/to/image.jpg"
winset(src, "pic", list2params(params))
One more question: is it possible to crop an image in an Output skin?

I tried cropping images with style sheets, but that doesn't seem to work. I tried messing around with the size and top parameters, but that doesn't work either.

Any ideas?
Best response
The output control is probably too limited to crop an image, it only supports some basic styling HTML/CSS. You would have better luck with the browser control.