SetDisplayZoom

Description

Sets the zoom factor of controls as a percent of their size at design time.

Syntax

SetDisplayZoom ( izoom, rebuild )

Argument

Description

izoom

Integer for the zoom factor that you want to set for all application controls.

rebuild

Boolean that determines whether the zoom factor applies to new controls only or to all controls in the application. Values are:

  • true All controls are resized

  • false Only controls in new windows are resized

Returns

Integer. Returns 1 if it succeeds and -1 if an error occurs.

Usage

The current zoom factor that you set in a SetDisplayZoom call applies to all controls (when rebuild = true) or all newly instantiated controls (when rebuild = false) in an application. However, when rebuild = true, the sizes of the bitmaps for radio buttons, check boxes, and the edit boxes of drop-down lists are not changed by a SetDisplayZoom call unless they are used as display formats for columns in a DataWindow. When the same controls are placed on application windows, the sizes of these controls’ bitmaps are fixed by the Windows CE operating system and can be modified only by a SetDisplayZoom call before they are loaded.

NoteSetting the zoom factor for windows with DataWindow controls The zoom value should be set before any dynamic changes are made to the DataWindow content since changing the display zoom value resets the DataWindow content.

The zoom factor is a percent of the size of the controls at design time. SetDisplayZoom works best for devices that have a VGA screen, such as the ASUS MyPal A730. The permissible zoom factor range is 10 to 500 percent. If you set a zoom factor outside of this range, PocketBuilder automatically resets the zoom factor to 100.

Although horizontal and vertical scroll bars are resized based on the zoom factor that you set in a SetDisplayZoom call, a threshold exists beyond which these controls cannot be painted. The threshold depends on the device resolution. For example, a scroll bar is not visible on a Dell Axim device with a 240 x 320 screen resolution if its height is less than 28 pixels.

Drawing objects, such as lines and ovals, are automatically repainted with the current zoom factor when an action causes the application window to be refreshed. This occurs even if you called SetDisplayZoom with the rebuild argument set to false.

See also

GetDisplayZoom