Using Phonebot display properties

From EtherWiki
(Redirected from Using display properties)
Jump to: navigation, search

Scripts can access display properties for modules and controls.

Methods

Syntax Description
value = get_display(group, property)
set_display(group, property, value)

The following groups and properties are valid:

Group Property Description
background color An ARGB value, see Color
font bold boolean
color An ARGB value, see Color
italic boolean
name monospace, normal (default), sans, serif
size
image scale see below
source URL or path to image
storage see below
padding bottom
left
right
top

Image properties are available for the image control. This control can display an image either from a URL or from the local file system.

The image can be stored in the following ways:

Name Value Description
Link link Always display the image located at the URL or directory.
Link with copy link_copy Display the linked image and store a local copy If the image is no longer available, the copy will be displayed.
Copy copy Always use a local copy.

The image can be scaled with the following methods:

Name Value Description
Center center Center the image in the view, but perform no scaling.
Center crop center_crop Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding).
Center inside center_inside Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).
Fit center fit_center Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. The result is centered inside dst.
Fit end fit_end Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. END aligns the result to the right and bottom edges of dst.
Fit start fit_start Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. START aligns the result to the left and top edges of dst.
Fit XY fit_xy Scale in X and Y independently, so that src matches dst exactly. This may change the aspect ratio of the src.

--ImageView.ScaleType

--Matrix.ScaleToFit

Phonebot Plus provides a dialog for setting these properties when developing applications.

Display-properties.small.png