Developer   API   Graphics   Bitmap   fromFile

Bitmap.fromFile

Function loads image from file. Supported types are: JPG and PNG.

Syntax

fromFile(file)

Example

this._img = Bitmap.fromFile("app://img.png"); ... canvas.drawBitmap(this._img, 0, 0);

Parameters

file : String |  - File name of a picture to be opened.

Returns

Returns type: Bitmap

Returns Bitmap object, with loaded picture.

Exceptions

Cannot decode image

Defined in

Bitmap
API Navigation
Skip Navigation Links.
Expand <span>User Interface</span> User Interface
Expand <span>Core & System</span> Core & System
Collapse <span>Graphics</span> Graphics
Canvas
Paint
Bitmap
Typeface
Path
Matrix
Shader
ColorFilter
MaskFilter
Expand <span>Files and Databases</span> Files and Databases
Expand <span>Crypto</span> Crypto
Expand <span>Native User Interface</span> Native User Interface
Expand <span>Net</span> Net
Expand <span>Media</span> Media
Expand <span>Sensor</span> Sensor
Expand <span>Game Development</span> Game Development