mIRC Home    About    Download    Register    News    Help

Print Thread
/drawpic middle of pindow #200985 16/06/08 08:51 AM
Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
Greetings
I would like to use /drawpic. How would i get it into the exact centre of the pic window?

Thanks in advance

Re: /drawpic middle of pindow [Re: Solo1] #200988 16/06/08 09:54 AM
Joined: Aug 2006
Posts: 182
T
Thrull Offline
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 182
Assuming you know the size of the window, it would be half the height and half the width. So, the middle of a pic window that's 100 by 150 would be the point at 50,75.


Yar
Re: /drawpic middle of pindow [Re: Thrull] #200991 16/06/08 11:45 AM
Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
I dont know the size of the window. It would be for windows of many diff sizes.

Re: /drawpic middle of pindow [Re: Solo1] #200996 16/06/08 01:26 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
The size is $window(@window) and use the .x .y .dx .dy properties depending on what you need. Divide by half. Then, for text, subtact half the $width() of the font/text/size so that you are centered. For a picture, subtract half the width of the picture. For height, do the same thing as width. Use $height() for the font/text/size.


Invision Support
#Invision on irc.irchighway.net
Re: /drawpic middle of pindow [Re: Solo1] #201001 16/06/08 02:14 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Code:
var %window = WINDOW_NAME
var %image = $qt(IMAGE_FILENAME)
var %x = $calc(($window(%window).dw - $pic(%image).width) / 2)
var %y = $calc(($window(%window).dh - $pic(%image).height) / 2)
drawpic %window %x %y %image


Obviously you need to replace WINDOW_NAME with the picture window you're drawing to and IMAGE_FILENAME with the filename of the image.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: /drawpic middle of pindow [Re: starbucks_mafia] #201004 16/06/08 03:04 PM
Joined: Mar 2007
Posts: 139
S
Solo1 Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
thank you starbucks_mafia you truly are a star!