Greetings
I would like to use /drawpic. How would i get it into the exact centre of the pic window?
Thanks in advance
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.
I dont know the size of the window. It would be for windows of many diff sizes.
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.
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.
thank you starbucks_mafia you truly are a star!