bool map_dialog_rectangle(handle dialog, irectangle* map)
This function converts a rectangle expressed in dialog units to a rectangle expressed in pixels.
handle dialog
The handle of the dialog relative to which the mapping occurs.
irectangle* map
A pointer to the rectangle to be converted.
bool
true | The units were successfuly converted. |
false | An error occurred. |
This function assumes that the initial coordinates in the provided rectangle structure are expressed in dialog box units. To convert these coordinates from dialog box units to pixels, the function obtains the current horizontal and vertical base units for the dialog box, then applies the following formulae.
rectangle[0](0) = (rectangle[0](0) * base_unit_x) / 4; rectangle[1](0) = (rectangle[0](0) * base_unit_x) / 4; rectangle[0](1) = (rectangle[0](1) * base_unit_y) / 8; rectangle[1](1) = (rectangle[1](1) * base_unit_y) / 8;
In most cases, the base units for a dialog box are the same as those obtained via the function get_dialog_base_units. However, if a dialog box template has the style dialog_style::set_font, the base units are the average width and height (in pixels) of the characters in the font given by the template.