mIRC Home    About    Download    Register    News    Help

Print Thread
picwin and images #210725 24/03/09 12:55 AM
Joined: Feb 2007
Posts: 234
M
MTec007 Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
im trying to figure out any way to load a png image from the web. is picwin capable of doing this?

Re: picwin and images [Re: MTec007] #210737 24/03/09 05:32 AM
Joined: Feb 2005
Posts: 342
R
Rand Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
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 }
}

Re: picwin and images [Re: Rand] #210738 24/03/09 05:47 AM
Joined: Feb 2007
Posts: 234
M
MTec007 Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
edit: how would i draw that picwin in the upper right hand corner of another window (not picwin) or can i do that?

Last edited by MTec007; 24/03/09 06:01 AM.
Re: picwin and images [Re: MTec007] #210739 24/03/09 06:05 AM
Joined: Feb 2005
Posts: 342
R
Rand Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
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.

Re: picwin and images [Re: Rand] #210740 24/03/09 06:34 AM
Joined: Feb 2007
Posts: 234
M
MTec007 Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
thanks