Personal tools
From wiki.swiftlytilting.com
Jump to: navigation, search

WinBinder Manual/wb get size

Gets the dimensions of a control, window or image.

Contents

Syntax

array wb_get_size (mixed object [, bool lparam])
object type lparam
A control handle Not used
A window handle If TRUE, the area returned will not include the title bar and borders. Default is FALSE.
A ListView handle If TRUE, the function returns an array with the widths of the column headers.
An icon handle Not used
A bitmap handle Not used
The name of a bitmap file Not used
The name of an icon file Not used
A string May be a font object to get the size of a string in a specific font. If left blank, the default font is used.

Returns

Generally it returns an array where the first element is the width and the second is the height. Measurements are in pixels. The function will return the integer WBC_MINIMIZED instead of an array if the requested window is minimized, or NULL on error.


Example

<?php
// 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(NULLPopupWindow"Tests"530320);
print_r(wb_get_size($mainwin));

// Get control dimensions

$label wb_create_control($mainwinLabel""102012020);
print_r(wb_get_size($frame));

// Get column widths of a ListView

print_r(wb_get_size($listtrue));
?>

See also

Winbinder Projects