-
DKTools.Utils.Bitmap.drawLine
(bitmap, x1, y1, x2, y2, color, lineWidth)
static
-
Draws the line to the bitmap
Name |
Type |
Default |
Description |
bitmap |
Bitmap
|
|
Bitmap |
x1 |
Number
|
|
The X coordinate of start of the line |
y1 |
Number
|
|
The Y coordinate of start of the line |
x2 |
Number
|
|
The X coordinate of end of the line |
y2 |
Number
|
|
The Y coordinate of end of the line |
color |
String
|
'white'
|
optional
Line color |
lineWidth |
Number
|
1
|
optional
Line width |
-
DKTools.Utils.Bitmap.getBase64
(bitmap)String | null
static
-
Returns base64 of the bitmap
Name |
Type |
Description |
bitmap |
Bitmap
|
Bitmap |
Returns:
Type |
Description |
String
|
null
|
Base64 of the bitmap |
-
DKTools.Utils.Bitmap.load
(object, filename, listener)Bitmap | null
static
-
Loads and returns a bitmap
Name |
Type |
Description |
object |
String
|
Bitmap
|
Object
|
Path to file or Bitmap or object with parameters |
filename |
String
|
Object
|
Name of file (if object is String) |
listener |
function
|
optional
Function of processing after loading a bitmap (if object is String) |
object.folder |
String
|
Path to file |
object.filename |
String
|
Name of file |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
Returns:
Type |
Description |
Bitmap
|
null
|
Loaded bitmap or null |
-
DKTools.Utils.Bitmap.loadAsync
(object, filename, listener)Promise.<(Bitmap|null)>
asyncstatic
-
Loads and returns a bitmap
Asynchronous version of DKTools.Utils.Bitmap.load
Promise resolves a loaded bitmap
Name |
Type |
Description |
object |
String
|
Bitmap
|
Object
|
Path to file or Bitmap or object with parameters |
filename |
String
|
Object
|
optional
Name of file (if object is String) |
listener |
function
|
optional
Function of processing after loading a bitmap (if object is String) |
object.folder |
String
|
Path to file |
object.filename |
String
|
Name of file |
object.listener |
function
|
optional
Function of processing after loading a bitmap |
Returns:
Type |
Description |
Promise.<(Bitmap|null)>
|
Loaded bitmap or null |
-
DKTools.Utils.Bitmap.loadBitmaps
(bitmaps, onLoadAllBitmaps, onLoadSomeBitmap)
static
-
Loads a bitmaps and call the callback function when all bitmaps are ready
Name |
Type |
Description |
bitmaps |
Array.<Bitmap>
|
Array.<Object>
|
Bitmaps to load |
onLoadAllBitmaps |
function
|
Function that is called when all bitmaps are loaded and ready |
onLoadSomeBitmap |
function
|
optional
Function that is called when some bitmap are loaded and ready |
bitmaps[].folder |
String
|
Path to file |
bitmaps[].filename |
String
|
Name of file |
bitmaps[].listener |
function
|
optional
Function of processing after loading a bitmap |
Example
var bitmaps = [];
bitmaps[0] = ImageManager.loadSystem('Window');
bitmaps[1] = {
folder: 'img/system/',
filename: 'IconSet'
};
DKTools.Utils.Bitmap.loadBitmaps(bitmaps, (allBitmaps) => {
// all loaded bitmaps
});
-
DKTools.Utils.Bitmap.loadBitmapsAsync
(bitmaps)Promise.<Array.<Bitmap>>
asyncstatic
-
Asynchronously loads a bitmaps
Promise resolves a loaded bitmaps
Name |
Type |
Description |
bitmaps |
Array.<Bitmap>
|
Array.<Object>
|
Bitmaps to load |
bitmaps[].folder |
String
|
Path to file |
bitmaps[].filename |
String
|
Name of file |
bitmaps[].listener |
function
|
optional
Function of processing after loading a bitmap |
Returns:
Type |
Description |
Promise.<Array.<Bitmap>>
|
Loaded bitmaps |