NativeScript Docs
Core Modules
NativeScript Angular
NativeScript UI
Article title
view in github
Search
Preparing search index...
The search index is not available
NativeScript
Options
All
Public
Public/Protected
All
Inherited
Only exported
Menu
Globals
"@nativescript/core"
ImageSource
Class ImageSource
Globals
"@nativescript/core"
Font
Style
Font
Weight
Grid
Unit
Type
Length
Percent
Length
Screen
ad
categories
encoding
ios
known
Folders
layout
message
Type
path
Image
Source
constructor
android
height
ios
rotation
Angle
width
from
Asset
from
Base64
from
Data
from
File
from
Resource
load
From
Base64
load
From
Data
load
From
File
load
From
Font
Icon
Code
load
From
Resource
save
ToFile
set
Native
Source
to
Base64
String
from
Asset
from
Base64
from
Base64
Sync
from
Data
from
Data
Sync
from
File
from
File
OrResource
Sync
from
File
Sync
from
Font
Icon
Code
Sync
from
Resource
from
Resource
Sync
from
Url
Hierarchy
ImageSource
Index
Constructors
constructor
Properties
android
height
ios
rotation
Angle
width
Methods
from
Asset
from
Base64
from
Data
from
File
from
Resource
load
From
Base64
load
From
Data
load
From
File
load
From
Font
Icon
Code
load
From
Resource
save
ToFile
set
Native
Source
to
Base64
String
from
Asset
from
Base64
from
Base64
Sync
from
Data
from
Data
Sync
from
File
from
File
OrResource
Sync
from
File
Sync
from
Font
Icon
Code
Sync
from
Resource
from
Resource
Sync
from
Url
Constructors
constructor
new
Image
Source
(
nativeSource
?:
any
)
:
ImageSource
Parameters
Optional
nativeSource:
any
Returns
ImageSource
Properties
android
android
:
any
height
height
:
number
ios
ios
:
any
rotation
Angle
rotation
Angle
:
number
width
width
:
number
Methods
from
Asset
from
Asset
(
asset
:
ImageAsset
)
:
Promise
<
ImageSource
>
Parameters
asset:
ImageAsset
Returns
Promise
<
ImageSource
>
from
Base64
from
Base64
(
source
:
string
)
:
Promise
<
boolean
>
Parameters
source:
string
Returns
Promise
<
boolean
>
from
Data
from
Data
(
data
:
any
)
:
Promise
<
boolean
>
Parameters
data:
any
Returns
Promise
<
boolean
>
from
File
from
File
(
path
:
string
)
:
Promise
<
boolean
>
Parameters
path:
string
Returns
Promise
<
boolean
>
from
Resource
from
Resource
(
name
:
string
)
:
Promise
<
boolean
>
Parameters
name:
string
Returns
Promise
<
boolean
>
load
From
Base64
load
From
Base64
(
source
:
string
)
:
boolean
Parameters
source:
string
Returns
boolean
load
From
Data
load
From
Data
(
data
:
any
)
:
boolean
Parameters
data:
any
Returns
boolean
load
From
File
load
From
File
(
path
:
string
)
:
boolean
Parameters
path:
string
Returns
boolean
load
From
Font
Icon
Code
load
From
Font
Icon
Code
(
source
:
string
, font
:
Font
, color
:
Color
)
:
boolean
Parameters
source:
string
font:
Font
color:
Color
Returns
boolean
load
From
Resource
load
From
Resource
(
name
:
string
)
:
boolean
Parameters
name:
string
Returns
boolean
save
ToFile
save
ToFile
(
path
:
string
, format
:
"png"
|
"jpeg"
|
"jpg"
, quality
?:
number
)
:
boolean
Parameters
path:
string
format:
"png"
|
"jpeg"
|
"jpg"
Optional
quality:
number
Returns
boolean
set
Native
Source
set
Native
Source
(
nativeSource
:
any
)
:
void
Parameters
nativeSource:
any
Returns
void
to
Base64
String
to
Base64
String
(
format
:
"png"
|
"jpeg"
|
"jpg"
, quality
?:
number
)
:
string
Parameters
format:
"png"
|
"jpeg"
|
"jpg"
Optional
quality:
number
Returns
string
Static
from
Asset
from
Asset
(
asset
:
ImageAsset
)
:
Promise
<
ImageSource
>
Parameters
asset:
ImageAsset
Returns
Promise
<
ImageSource
>
Static
from
Base64
from
Base64
(
source
:
string
)
:
Promise
<
ImageSource
>
Parameters
source:
string
Returns
Promise
<
ImageSource
>
Static
from
Base64
Sync
from
Base64
Sync
(
source
:
string
)
:
ImageSource
Parameters
source:
string
Returns
ImageSource
Static
from
Data
from
Data
(
data
:
any
)
:
Promise
<
ImageSource
>
Parameters
data:
any
Returns
Promise
<
ImageSource
>
Static
from
Data
Sync
from
Data
Sync
(
data
:
any
)
:
ImageSource
Parameters
data:
any
Returns
ImageSource
Static
from
File
from
File
(
path
:
string
)
:
Promise
<
ImageSource
>
Parameters
path:
string
Returns
Promise
<
ImageSource
>
Static
from
File
OrResource
Sync
from
File
OrResource
Sync
(
path
:
string
)
:
ImageSource
Parameters
path:
string
Returns
ImageSource
Static
from
File
Sync
from
File
Sync
(
path
:
string
)
:
ImageSource
Parameters
path:
string
Returns
ImageSource
Static
from
Font
Icon
Code
Sync
from
Font
Icon
Code
Sync
(
source
:
string
, font
:
Font
, color
:
Color
)
:
ImageSource
Parameters
source:
string
font:
Font
color:
Color
Returns
ImageSource
Static
from
Resource
from
Resource
(
name
:
string
)
:
Promise
<
ImageSource
>
Parameters
name:
string
Returns
Promise
<
ImageSource
>
Static
from
Resource
Sync
from
Resource
Sync
(
name
:
string
)
:
ImageSource
Parameters
name:
string
Returns
ImageSource
Static
from
Url
from
Url
(
url
:
string
)
:
Promise
<
ImageSource
>
Parameters
url:
string
Returns
Promise
<
ImageSource
>
Legend
Module
Object literal
Variable
Function
Function with type parameter
Index signature
Type alias
Enumeration
Enumeration member
Property
Method
Interface
Interface with type parameter
Constructor
Property
Method
Index signature
Class
Class with type parameter
Constructor
Property
Method
Accessor
Index signature
Inherited constructor
Inherited property
Inherited method
Inherited accessor
Protected property
Protected method
Protected accessor
Private property
Private method
Private accessor
Static property
Static method
🐛 Debug your mobile network traffic with Fiddler! Try it on
iOS
or
Android