procedure IMGSRC (url : string, x,y,scale : int, alt : string)
var netStream : int
var net_line : char
netStream := Net.OpenURLConnection (url)
if netStream <= 0 then
put "Unable to download jpeg ", url, "!"
return
end if
var fileNo : int
open : fileNo, "render.jpg", write
loop
exit when eof (netStream)
get : netStream, net_line
write : fileNo, net_line
end loop
Net.CloseConnection (netStream)
close : fileNo
var newPic : int
newPic := Pic.FileNew ("render.jpg")
var width : int := Pic.Width (newPic)
var height : int := Pic.Height (newPic)
newPic := Pic.Scale (newPic, scale * width,
scale * height)
Pic.Draw (newPic, x, y, picCopy)
Pic.Free (newPic)
end IMGSRC
Future
/*You probably want to change this address to something on your server ... also note that I have used my IP->~path to my site (www.eclipticalmedia.net) because there is a small redireciton issue with some sites that you will encounter....*/
IMGSRC ("http://72.29.76.231/~eclipti/turing/picture.jpg", 0,0,2, "")
|