Nativescript Doc
Preparing search index...
The search index is not available
Documentation
Documentation
ui-canvas
Canvas
Class Canvas
Hierarchy (
View Summary
)
ProxyClass
Canvas
Index
Constructors
constructor
Methods
clear
clip
Out
Path
clip
Out
Rect
clip
Path
clip
Rect
concat
draw
Arc
drawARGB
draw
Bitmap
draw
Circle
draw
Color
draw
Line
draw
Lines
draw
Oval
draw
Paint
draw
Path
draw
Point
draw
Points
draw
Pos
Text
draw
Rect
drawRGB
draw
Round
Rect
draw
Text
draw
Text
On
Path
draw
Text
Run
draw
View
get
Clip
Bounds
get
Density
get
Draw
Filter
get
Height
get
Image
get
Native
get
Width
release
restore
restore
To
Count
rotate
save
scale
set
Bitmap
set
Context
set
Density
set
Draw
Filter
set
Matrix
set
Native
skew
translate
Constructors
constructor
new
Canvas
(
imageOrWidth
?:
any
,
height
?:
number
)
:
Canvas
Parameters
Optional
imageOrWidth
:
any
Optional
height
:
number
Returns
Canvas
Methods
clear
clear
()
:
any
Returns
any
clip
Out
Path
clipOutPath
(
path
:
Path
)
:
boolean
Parameters
path
:
Path
Returns
boolean
clip
Out
Rect
clipOutRect
(
left
:
number
,
top
:
number
,
right
:
number
,
bottom
:
number
)
:
boolean
Parameters
left
:
number
top
:
number
right
:
number
bottom
:
number
Returns
boolean
clipOutRect
(
rect
:
Rect
)
:
boolean
Parameters
rect
:
Rect
Returns
boolean
clip
Path
clipPath
(
path
:
Path
)
:
boolean
Parameters
path
:
Path
Returns
boolean
clipPath
(
path
:
Path
,
op
:
Op
)
:
boolean
Parameters
path
:
Path
op
:
Op
Returns
boolean
clip
Rect
clipRect
(
rect
:
Rect
)
:
boolean
Parameters
rect
:
Rect
Returns
boolean
clipRect
(
left
:
number
,
top
:
number
,
right
:
number
,
bottom
:
number
)
:
boolean
Parameters
left
:
number
top
:
number
right
:
number
bottom
:
number
Returns
boolean
clipRect
(
left
:
number
,
top
:
number
,
right
:
number
,
bottom
:
number
,
op
:
Op
,
)
:
boolean
Parameters
left
:
number
top
:
number
right
:
number
bottom
:
number
op
:
Op
Returns
boolean
clipRect
(
rect
:
Rect
,
op
:
Op
)
:
boolean
Parameters
rect
:
Rect
op
:
Op
Returns
boolean
concat
concat
(
mat
:
Matrix
)
:
any
Parameters
mat
:
Matrix
Returns
any
draw
Arc
drawArc
(
rect
:
Rect
,
startAngle
:
number
,
sweepAngle
:
number
,
useCenter
:
boolean
,
paint
:
Paint
,
)
:
void
Parameters
rect
:
Rect
startAngle
:
number
sweepAngle
:
number
useCenter
:
boolean
paint
:
Paint
Returns
void
drawArc
(
left
:
number
,
top
:
number
,
right
:
number
,
bottom
:
number
,
startAngle
:
number
,
sweepAngle
:
number
,
useCenter
:
boolean
,
paint
:
Paint
,
)
:
void
Parameters
left
:
number
top
:
number
right
:
number
bottom
:
number
startAngle
:
number
sweepAngle
:
number
useCenter
:
boolean
paint
:
Paint
Returns
void
drawARGB
drawARGB
(
a
:
number
,
r
:
number
,
g
:
number
,
b
:
number
)
:
void
Parameters
a
:
number
r
:
number
g
:
number
b
:
number
Returns
void
draw
Bitmap
drawBitmap
(
bitmap
:
any
,
src
:
Rect
,
dest
:
Rect
,
paint
:
Paint
)
:
void
Parameters
bitmap
:
any
src
:
Rect
dest
:
Rect
paint
:
Paint
Returns
void
drawBitmap
(
bitmap
:
any
,
x
:
number
,
y
:
number
,
paint
:
Paint
)
:
void
Parameters
bitmap
:
any
x
:
number
y
:
number
paint
:
Paint
Returns
void
drawBitmap
(
bitmap
:
any
,
matrix
:
Matrix
,
paint
:
Paint
)
:
any
Parameters
bitmap
:
any
matrix
:
Matrix
paint
:
Paint
Returns
any
draw
Circle
drawCircle
(
cx
:
number
,
cy
:
number
,
radius
:
number
,
paint
:
Paint
)
:
void
Parameters
cx
:
number
cy
:
number
radius
:
number
paint
:
Paint
Returns
void
draw
Color
drawColor
(
color
:
any
)
:
void
Parameters
color
:
any
Returns
void
draw
Line
drawLine
(
startX
:
number
,
startY
:
number
,
stopX
:
number
,
stopY
:
number
,
paint
:
Paint
,
)
:
void
Parameters
startX
:
number
startY
:
number
stopX
:
number
stopY
:
number
paint
:
Paint
Returns
void
draw
Lines
drawLines
(
pts
:
number
[]
,
offset
:
number
,
count
:
number
,
paint
:
Paint
,
mat
?:
Matrix
,
)
:
void
Parameters
pts
:
number
[]
offset
:
number
count
:
number
paint
:
Paint
Optional
mat
:
Matrix
Returns
void
drawLines
(
pts
:
number
[]
,
paint
:
Paint
,
mat
?:
Matrix
)
:
void
Parameters
pts
:
number
[]
paint
:
Paint
Optional
mat
:
Matrix
Returns
void
draw
Oval
drawOval
(
rect
:
Rect
,
paint
:
Paint
)
:
void
Parameters
rect
:
Rect
paint
:
Paint
Returns
void
drawOval
(
left
:
number
,
top
:
number
,
right
:
number
,
bottom
:
number
,
paint
:
Paint
,
)
:
void
Parameters
left
:
number
top
:
number
right
:
number
bottom
:
number
paint
:
Paint
Returns
void
draw
Paint
drawPaint
(
apint
:
Paint
)
:
void
Parameters
apint
:
Paint
Returns
void
draw
Path
drawPath
(
path
:
Path
,
paint
:
Paint
)
:
void
Parameters
path
:
Path
paint
:
Paint
Returns
void
draw
Point
drawPoint
(
x
:
number
,
y
:
number
,
paint
:
Paint
)
:
void
Parameters
x
:
number
y
:
number
paint
:
Paint
Returns
void
draw
Points
drawPoints
(
pts
:
number
[]
,
paint
:
Paint
)
:
void
Parameters
pts
:
number
[]
paint
:
Paint
Returns
void
draw
Pos
Text
drawPosText
(
text
:
string
,
pos
:
number
[]
,
paint
:
Paint
)
:
void
Parameters
text
:
string
pos
:
number
[]
paint
:
Paint
Returns
void
drawPosText
(
text
:
string
[]
,
index
:
number
,
count
:
number
,
pos
:
number
[]
,
paint
:
Paint
,
)
:
void
Parameters
text
:
string
[]
index
:
number
count
:
number
pos
:
number
[]
paint
:
Paint
Returns
void
draw
Rect
drawRect
(
left
:
number
,
top
:
number
,
right
:
number
,
bottom
:
number
,
paint
:
Paint
,
)
:
void
Parameters
left
:
number
top
:
number
right
:
number
bottom
:
number
paint
:
Paint
Returns
void
drawRect
(
rect
:
Rect
,
paint
:
Paint
)
:
void
Parameters
rect
:
Rect
paint
:
Paint
Returns
void
drawRGB
drawRGB
(
r
:
number
,
g
:
number
,
b
:
number
)
:
void
Parameters
r
:
number
g
:
number
b
:
number
Returns
void
draw
Round
Rect
drawRoundRect
(
left
:
number
,
top
:
number
,
right
:
number
,
bottom
:
number
,
rx
:
number
,
ry
:
number
,
paint
:
Paint
,
)
:
void
Parameters
left
:
number
top
:
number
right
:
number
bottom
:
number
rx
:
number
ry
:
number
paint
:
Paint
Returns
void
drawRoundRect
(
rect
:
Rect
,
rx
:
number
,
ry
:
number
,
paint
:
Paint
)
:
void
Parameters
rect
:
Rect
rx
:
number
ry
:
number
paint
:
Paint
Returns
void
draw
Text
drawText
(
text
:
string
,
start
:
number
,
end
:
number
,
x
:
number
,
y
:
number
,
paint
:
Paint
,
)
:
void
Parameters
text
:
string
start
:
number
end
:
number
x
:
number
y
:
number
paint
:
Paint
Returns
void
drawText
(
char
:
any
[]
,
index
:
number
,
count
:
number
,
x
:
number
,
y
:
number
,
paint
:
Paint
,
)
:
void
Parameters
char
:
any
[]
index
:
number
count
:
number
x
:
number
y
:
number
paint
:
Paint
Returns
void
drawText
(
text
:
string
,
x
:
number
,
y
:
number
,
paint
:
Paint
)
:
void
Parameters
text
:
string
x
:
number
y
:
number
paint
:
Paint
Returns
void
draw
Text
On
Path
drawTextOnPath
(
text
:
string
,
path
:
Path
,
hOffset
:
number
,
vOffset
:
number
,
paint
:
Paint
,
)
:
void
Parameters
text
:
string
path
:
Path
hOffset
:
number
vOffset
:
number
paint
:
Paint
Returns
void
draw
Text
Run
drawTextRun
(
text
:
string
,
start
:
number
,
end
:
number
,
contextStart
:
number
,
contextEnd
:
number
,
x
:
number
,
y
:
number
,
isRtl
:
boolean
,
paint
:
Paint
,
)
:
void
Parameters
text
:
string
start
:
number
end
:
number
contextStart
:
number
contextEnd
:
number
x
:
number
y
:
number
isRtl
:
boolean
paint
:
Paint
Returns
void
draw
View
drawView
(
view
:
View
,
rect
?:
Rect
)
:
any
Parameters
view
:
View
Optional
rect
:
Rect
Returns
any
get
Clip
Bounds
getClipBounds
()
:
Rect
Returns
Rect
get
Density
getDensity
()
:
number
Returns
number
get
Draw
Filter
getDrawFilter
()
:
DrawFilter
Returns
DrawFilter
get
Height
getHeight
()
:
number
Returns
number
get
Image
getImage
()
:
any
Returns
any
get
Native
getNative
()
:
any
Returns
any
get
Width
getWidth
()
:
number
Returns
number
release
release
()
:
any
Returns
any
restore
restore
()
:
void
Returns
void
restore
To
Count
restoreToCount
(
count
:
number
)
:
void
Parameters
count
:
number
Returns
void
rotate
rotate
(
degrees
:
number
)
:
void
Parameters
degrees
:
number
Returns
void
rotate
(
degrees
:
number
,
px
:
number
,
py
:
number
)
:
void
Parameters
degrees
:
number
px
:
number
py
:
number
Returns
void
save
save
()
:
number
Returns
number
scale
scale
(
sx
:
number
,
sy
:
number
,
px
:
number
,
py
:
number
)
:
void
Parameters
sx
:
number
sy
:
number
px
:
number
py
:
number
Returns
void
scale
(
sx
:
number
,
sy
:
number
)
:
void
Parameters
sx
:
number
sy
:
number
Returns
void
set
Bitmap
setBitmap
(
image
:
any
)
:
any
Parameters
image
:
any
Returns
any
set
Context
setContext
(
context
:
any
,
width
:
any
,
height
:
any
)
:
any
Parameters
context
:
any
width
:
any
height
:
any
Returns
any
set
Density
setDensity
(
density
:
number
)
:
void
Parameters
density
:
number
Returns
void
set
Draw
Filter
setDrawFilter
(
filter
:
DrawFilter
)
:
void
Parameters
filter
:
DrawFilter
Returns
void
set
Matrix
setMatrix
(
matrix
:
Matrix
)
:
void
Parameters
matrix
:
Matrix
Returns
void
set
Native
setNative
(
object
:
any
)
:
any
Parameters
object
:
any
Returns
any
skew
skew
(
sx
:
number
,
sy
:
number
)
:
void
Parameters
sx
:
number
sy
:
number
Returns
void
translate
translate
(
dx
:
number
,
dy
:
number
)
:
void
Parameters
dx
:
number
dy
:
number
Returns
void
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
clear
clip
Out
Path
clip
Out
Rect
clip
Path
clip
Rect
concat
draw
Arc
drawARGB
draw
Bitmap
draw
Circle
draw
Color
draw
Line
draw
Lines
draw
Oval
draw
Paint
draw
Path
draw
Point
draw
Points
draw
Pos
Text
draw
Rect
drawRGB
draw
Round
Rect
draw
Text
draw
Text
On
Path
draw
Text
Run
draw
View
get
Clip
Bounds
get
Density
get
Draw
Filter
get
Height
get
Image
get
Native
get
Width
release
restore
restore
To
Count
rotate
save
scale
set
Bitmap
set
Context
set
Density
set
Draw
Filter
set
Matrix
set
Native
skew
translate
Nativescript Doc
Documentation
Loading...