centerRect

Typeproperty
DictionaryLCS
LibraryLiveCode Script
Syntax
set the centerRect[angle] of <image> to <rectangle>
get the [effective] centerRect[angle] of <image>
Associationsimage
Summary

Specifies a region of pixels that should be stretched when the image is stretched.

Introduced6.7
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
image

A reference or expression that evaluate to an image reference.

rectangle

Empty or a comma delimited list of 4 integers representing the left,top,right,bottom of the rectangle being specified. By default, the centerRect property is empty.

Example
set the centerRect of image "buttonImage" to 20,20,45,200
Values
NameTypeDescription
Value

The centerRect property return a comma delimited list of integers representing the top, left, right and bottom of the centerRect. By default, the centerRect property of an image is empty.

RelatedProperty: rectangle
Description

Use to centerRect property to specifies a region of pixels that should be stretched when the image is stretched.

If empty, then the property has no effect.

If the centerRect is set to a rectangle, then it is interpreted as relative to the source image rect (i.e. 0, 0, the formattedWidth of image, the formattedHeight of image) and it specifies a region of pixels that should be stretched when the image is stretched. In particular, the centerRect is stretched in both x and y directions, the corners outside of the centerRect are not stretched and the sides are stretched horizontally or vertically only depending on orientation.

The centerRect is useful for images being used as backgrounds to buttons as it allows a single image to be used to specify the borders and center stretching area.

Tagsui