picwin and images - 24/03/09 12:55 AM
im trying to figure out any way to load a png image from the web. is picwin capable of doing this?
alias dlimage { sockopen dlimage www.google.com 80 if ($isfile(tempimage.gif)) { .remove tempimage.gif } } on *:sockopen:dlimage:{ var %% = sockwrite -n $sockname %% GET /intl/en_ALL/images/logo.gif HTTP/1.0 %% Host: www.google.com %% } on *:sockread:dlimage:{ var %s | sockread %s while ($sockbr) { if (!%s) { ; Image starts now. sockrename dlimage tempimage return } sockread %s } } on *:sockread:tempimage:{ sockread &lol bwrite tempimage.gif -1 -1 &lol } on *:sockclose:tempimage:{ window -p @tempimage drawpic @tempimage 0 0 tempimage.gif if ($isfile(tempimage.gif)) { .remove tempimage.gif } }