Image object
image (picture).
Constants |
|
N/A |
Properties |
| url |
- string, url where this image came from. |
| width |
- integer, pixels, width of the image. read-only property. |
| height |
- integer, pixels, height of the image. read-only property. |
| graphics |
- Graphics, returns graphics object that can be used for drawing on the image surface. |
Methods |
| this |
( width:integer, height:integer [, color: integer = 0] )
Constructs new Image object and initializes it by the color. |
| render |
( what: Element )
Renders the what element on the image. Before rendering the element gets dimensions of the image so its border box covers the image in full. |
| destroy |
()
Destroys underlying native bitmap. Use this method to force the image to release its bitmap (that can be pretty big) when it is not needed. |
| toBytes |
( [ compressionLevel:integer] ) : Bytes
Saves content of the image as a byte vector that can be used e.g. for uploading on the server.
compressionLevel is a number in the range 10..100 - JPEG compression level. If it is omitted or zero then the image is saved using PNG encoding. |
| scale |
( width, height )
Scales - changes dimensions of the image. |
| toString |
( #png | #jpeg [, bpp] ) : string
Saves content of the image as a base64 encoded string. |
| saveAs |
( #png | #jpeg [, bpp] ) : true | false
Saves content of the image as file on the disk. Method opens file dialog allowing user to select file name. |
* - grayed items are planned but not yet implemented.
|