Phone API Reference - UI Classes (Widgets) - Image - resize
resize
Description
Changes the size of the image. If either width or height is set to 0, the image will be scaled to the other width/height, maintaining the aspect ratio.
Basic Example:Â
imageObj.resize(width, height); |
Â
Parameters
Name | Required | Type | Default | Description |
---|---|---|---|---|
height | Yes | integer | Â | Height in pixels. |
width | Yes | integer | Â | Width in pixels. |
Â
Examples
resize an image widget to width of 20 pixels and preserve the previous aspect ratio
var testImage = new Image(0, 0, 40, 100);Â Â Â Â Â Â Â // image at 0,0 width=40 height = 100
testImage.resize(20, 0);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â // image at 0,0 width=20 height = 50 |
Â