mIRC Homepage
Posted By: MTec007 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?
Posted By: Rand Re: picwin and images - 24/03/09 05:32 AM
You're lucky I still had this from when I showed someone else how to do this a long time ago. I didn't include much error checking, but this should give you an idea of how to do it. :P

Note, if you have an image file called "tempimage.gif" in your mIRC Directory, using this script will delete it.

Code:
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 }
}
Posted By: MTec007 Re: picwin and images - 24/03/09 05:47 AM
edit: how would i draw that picwin in the upper right hand corner of another window (not picwin) or can i do that?
Posted By: Rand Re: picwin and images - 24/03/09 06:05 AM
For the double click thing: /help menu prefix

As for using the pic in another non-picwin window, you'd have to resort to /background.
Posted By: MTec007 Re: picwin and images - 24/03/09 06:34 AM
thanks
© mIRC Discussion Forums