photonui.Canvas Class
Canvas.
Constructor
photonui.Canvas
-
params
Parameters:
-
params
ObjectAn object that can contain any property of the widget (optional).
Item Index
Methods
- __onContextMenu
- __onLocaleChanged
- _bindEvent
- _buildHtml
- _callCallbacks
- _registerWEvents
- _unbindEvent
- _updateProperties deprecated
- _visibilityChanged
- addClass
- destroy
- getContext
- hide
- registerCallback
- removeCallback
- removeClass
- setContext
- show
- supportsContext
- toBlob
- toBlobHD
- toDataURL
- toDataURLHD
- transferControlToProxy
- unparent
Methods
__onContextMenu
-
event
Parameters:
-
event
Object
__onLocaleChanged
()
private
Called when the locale is changed.
_bindEvent
-
id
-
element
-
evName
-
callback
-
[options]
Parameters:
_buildHtml
()
private
Build the widget HTML.
_callCallbacks
-
wEvent
-
params
_updateProperties
-
properties
Parameters:
-
properties
ArrayThe properties to update.
_visibilityChanged
-
visibility
Parameters:
-
visibility
BooleanCurrent visibility state (otptional, defaut=this.visible)
addClass
-
className
Parameters:
-
className
StringThe class to add.
destroy
()
getContext
-
contextId
Returns a drawing context on the canvas.
Proxy of the native canvas method. For more informations see:
Parameters:
-
contextId
String
Returns:
The drawing context.
hide
()
registerCallback
-
id
-
wEvent
-
callback
-
thisArg
removeClass
-
className
Parameters:
-
className
StringThe class to remove.
setContext
-
contextId
Changes the context the element is related to to the given one.
Proxy of the native canvas method if exists. For more informations see:
Parameters:
-
contextId
String
show
()
supportsContext
-
contextId
Indicate if the given context is supported by this canvas.
Proxy of the native canvas method if exists. For more informations see:
Parameters:
-
contextId
String
Returns:
toBlob
-
type
Returns a Blob object representing the image contained in the canvas (at 96dpi).
Proxy of the native canvas method if exists. For more informations see:
Parameters:
-
type
StringThe image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")
Returns:
toBlobHD
-
type
Returns a Blob object representing the image contained in the canvas (at the native resolution of the canvas).
Proxy of the native canvas method if exists. For more informations see:
Parameters:
-
type
StringThe image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")
Returns:
toDataURL
-
type
Returns a "data:" URL containing a representation of the image (at 96dpi).
Proxy of the native canvas method. For more informations see:
Parameters:
-
type
StringThe image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")
Returns:
The data URL
toDataURLHD
-
type
Returns a "data:" URL containing a representation of the image (at the native resolution of the canvas).
Proxy of the native canvas method if exists. For more informations see:
Parameters:
-
type
StringThe image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")
Returns:
The data URL
transferControlToProxy
()
Gives back a proxy to allow the canvas to be used in another Worker.
Proxy of the native canvas method if exists. For more informations see:
unparent
()
Properties
__events
Object
private
contextMenuName
String
photonui.PopupWindow().name
).
Default: null (= no context menu)
height
Number
default 150
Canvas height.
width
Number
default 300
Canvas width.