wb_get_size

array wb_get_size (mixed object [, bool lparam])

Gets the dimensions of a control, window or image.

Generally it returns an array where the first element is the width and the second is the height. Measurements are in pixels. If lparam is TRUE, the area returned will not include the title bar and borders. Default is FALSE. The function will return the integer WBC_MINIMIZED instead of an array if the requested window is minimized, or NULL on error.

If object is a ListView handle and lparam is TRUE, the function returns an array with the widths of the column headers. If lparam is omitted or FALSE, the function behaves normally like described above

Object types accepted

object may be one of the following:

Example

// Obtain and print out various dimensions

define("PATH_RES", "../resources/");

// Get bitmap dimensions

print_r(wb_get_size(PATH_RES . "toolbar.bmp"));
$img = wb_load_image(PATH_RES . "toolbar.bmp");
print_r(wb_get_size($img));

// Get icon dimensions

$img = wb_load_image(PATH_RES . "ttf.ico");
print_r(wb_get_size($img));
print_r(wb_get_size(PATH_RES . "ttf.ico"));

// Get window dimensions

$mainwin = wb_create_window(NULL, PopupWindow, "Tests", 530, 320);
print_r(wb_get_size($mainwin));

// Get control dimensions

$label = wb_create_control($mainwin, Label, "", 10, 20, 120, 20);
print_r(wb_get_size($frame));

// Get column widths of a ListView

print_r(wb_get_size($list, true));

See also

wb_get_position
wb_set_size
Image functions
Control functions
Window functions