mIRC Homepage
Posted By: Lucifer Pixels to DBU - 18/01/03 04:05 PM
Is there a way to convert pixels to dbu. If I had a dialog like
Code:
dialog test {
  title ""
  size -1 -1 200  100 
  option dbu
}

and I want to use /dialog -s it uses pixels to size the dialog (I think) I need to convert the pixels to dbu
and the $width returns the numbers as pixels I need to convert those to. There must be a way... right?
Posted By: Hammer Re: Pixels to DBU - 18/01/03 08:21 PM
Dbu vs. Pixels
The dbu option makes mIRC use dialog base units when creating the dialog, this ensures that the dialog will look the same for all users under any size display, etc. Pixels is the default however to maintain compatibility with previous scripts.

The identifiers $dbuw and $dbuh return the dbu per pixel width and height values for the current display. This may or may not be an integer value.

dialog -s $dname $dialog($dname).x $dialog($dname).y $calc($width(%text,%font,%fontsize) * $dbuw) $dialog($dname).h
Posted By: Lucifer Re: Pixels to DBU - 19/01/03 03:51 AM
As always Hammer comes to the rescue wink Thanks
© mIRC Discussion Forums