@DOMObjectAttribute @DOMNameAttribute(name="HTMLCanvasElement") public class HTMLCanvasElement extends HTMLElement
The HTMLCanvasElement interface provides properties and methods for manipulating the layout and presentation of canvas elements. The HTMLCanvasElement interface also inherits the properties and methods of the HTMLElement interface.
Node.Flags
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HEIGHT |
static int |
DEFAULT_WIDTH |
OnAbort, OnAbortDelegate, OnBlur, OnBlurDelegate, OnCancel, OnCancelDelegate, OnCanplay, OnCanplayDelegate, OnCanPlayThrough, OnCanPlayThroughDelegate, OnChange, OnChangeDelegate, OnClick, OnClickDelegate, OnCueChange, OnCueChangeDelegate, OnDblClick, OnDblClickDelegate, OnDurationChange, OnDurationChangeDelegate, OnEmptied, OnEmptiedDelegate, OnEnded, OnEndedDelegate, OnError, OnErrorDelegate, OnFocus, OnFocusDelegate, OnInput, OnInputDelegate, OnInvalid, OnInvalidDelegate, OnKeyDown, OnKeyDownDelegate, OnKeyPress, OnKeyPressDelegate, OnKeyUp, OnKeyUpDelegate, OnLoad, OnLoadDelegate, OnLoadedData, OnLoadedDataDelegate, OnLoadedMetadata, OnLoadedMetadataDelegate, OnLoadStart, OnLoadStartDelegate, OnMouseDown, OnMouseDownDelegate, OnMouseEnter, OnMouseEnterDelegate, OnMouseLeave, OnMouseLeaveDelegate, OnMouseMove, OnMouseMoveDelegate, OnMouseOut, OnMouseOutDelegate, OnMouseOver, OnMouseOverDelegate, OnMouseUp, OnMouseUpDelegate, OnMouseWheel, OnMouseWheelDelegate, OnPause, OnPauseDelegate, OnPlay, OnPlayDelegate, OnPlaying, OnPlayingDelegate, OnProgress, OnProgressDelegate, OnRateChange, OnRateChangeDelegate, OnReset, OnResetDelegate, OnResize, OnResizeDelegate, OnScroll, OnScrollDelegate, OnSeeked, OnSeekedDelegate, OnSeeking, OnSeekingDelegate, OnSelect, OnSelectDelegate, OnShow, OnShowDelegate, OnStalled, OnStalledDelegate, OnSubmit, OnSubmitDelegate, OnSuspend, OnSuspendDelegate, OnTimeUpdate, OnTimeUpdateDelegate, OnToggle, OnToggleDelegate, OnVolumeChange, OnVolumeChangeDelegate, OnWaiting, OnWaitingDelegate
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, flags, nodeDocument, NOTATION_NODE, parent, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
EventMap
PropertyChanged, PropertyChangedDelegate
Constructor and Description |
---|
HTMLCanvasElement(com.aspose.html.dom.DOMName name,
Document doc) |
Modifier and Type | Method and Description |
---|---|
com.aspose.html.io.Blob |
getBlob() |
com.aspose.html.io.Blob |
getBlob(java.lang.String type) |
com.aspose.html.io.Blob |
getBlob(java.lang.String type,
double encoderOptions) |
java.lang.Object |
getContext(java.lang.String contextId,
java.lang.Object... args)
Returns a drawing context on the canvas, or null if the context ID is not supported.
|
long |
getHeight()
Is a positive integer reflecting the height HTML attribute of the canvas element interpreted in CSS pixels.
|
long |
getWidth()
Is a positive integer reflecting the width HTML attribute of the canvas element interpreted in CSS pixels.
|
void |
setHeight(long value)
Is a positive integer reflecting the height HTML attribute of the canvas element interpreted in CSS pixels.
|
void |
setWidth(long value)
Is a positive integer reflecting the width HTML attribute of the canvas element interpreted in CSS pixels.
|
void |
toBlob(java.lang.String mimeType,
double qualityArgument)
Creates a Blob object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent.
|
java.lang.String |
toDataURL(java.lang.String type,
double encoderOptions)
returns a data URI containing a representation of the image in the format specified by the type parameter (defaults to PNG).
|
getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getAttributeOrDefault, getChildOfType, getClassName_Rename_Namesake, getDir, getId_Rename_Namesake, getLang, getParentOfType, getRowIndexInScopeOfCollection, getStyle, getTitle, setAttribute, setAttribute, setAttribute, setClassName_Rename_Namesake, setDir, setId_Rename_Namesake, setLang, setTitle, toggleAttribute
attachShadow, dispose, equals, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildElementCount, getChildren, getClassName, getComputedStyle, getComputedStyle, getData, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getId, getInnerHTML, getLastElementChild, getLocalName, getNamespaceURI, getNextElementSibling, getNodeName, getNodeType, getOuterHTML, getPrefix, getPreviousElementSibling, getSchemaTypeInfo, getShadowRoot, getStyleContainer, getTag, getTagName, getTextContent, hasAttribute, hasAttributeNS, hasAttributes, querySelector, querySelectorAll, remove, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setData, setId, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setInnerHTML, setOuterHTML, setTextContent
adoptNode, appendChild, cloneNode, deepClone, finalize, getBaseURI, getChildNodes, getChildNodesInternal, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, getRegisteredObservers, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceAll, replaceChild, setLocalName, setNamespaceURI, setNodeValue, setParentNode, setPrefix, toString
addEventListener, addEventListener, addEventListener, addEventListener, dispatchEvent, dispose, removeEventListener, removeEventListener, removeEventListener
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBinding
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public HTMLCanvasElement(com.aspose.html.dom.DOMName name, Document doc)
@DOMNameAttribute(name="width") public long getWidth()
Is a positive integer reflecting the width HTML attribute of the canvas element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.
@DOMNameAttribute(name="width") public void setWidth(long value)
Is a positive integer reflecting the width HTML attribute of the canvas element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.
@DOMNameAttribute(name="height") public long getHeight()
Is a positive integer reflecting the height HTML attribute of the canvas element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.
@DOMNameAttribute(name="height") public void setHeight(long value)
Is a positive integer reflecting the height HTML attribute of the canvas element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.
@DOMNameAttribute(name="toDataURL") public java.lang.String toDataURL(@DOMParameterAttribute(name="type",optional=true) java.lang.String type, @DOMParameterAttribute(name="type",optional=true) double encoderOptions)
returns a data URI containing a representation of the image in the format specified by the type parameter (defaults to PNG). The returned image is in a resolution of 96 dpi.
type
- A string indicating the image format. The default format type is image/png.encoderOptions
- A Number between 0 and 1 indicating image quality if the requested type is image/jpeg or image/webp.@DOMNameAttribute(name="toBlob") public void toBlob(@DOMParameterAttribute(name="type",optional=true) java.lang.String mimeType, @DOMParameterAttribute(name="type",optional=true) double qualityArgument)
Creates a Blob object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent.
mimeType
- qualityArgument
- public com.aspose.html.io.Blob getBlob()
public com.aspose.html.io.Blob getBlob(java.lang.String type)
public com.aspose.html.io.Blob getBlob(java.lang.String type, double encoderOptions)
@DOMNameAttribute(name="getContext") public java.lang.Object getContext(java.lang.String contextId, java.lang.Object... args)
Returns a drawing context on the canvas, or null if the context ID is not supported. A drawing context lets you draw on the canvas.
contextId
- Is a string containing the context identifier defining the drawing context associated to the canvasargs
- Context attributes