HTML and CSS Reference
In-Depth Information
HTML5.1 Canvas Context
In HTML5.1, the Canvas context will include some methods beyond toDataURL() and
getContext() .
supportsContext()
This method will allow a developer to test for support for different Canvas contexts in a web
browser. In this topic, we used the 2D context most of the time, but we added “experimental-
wbgl” in this chapter, or “moz-3d.” In the future, the new Canvas context will be registered at
this site .
toDataURLHD(), toBlob(), toBlobHD()
If you recall from earlier in the topic, toDataURL() allows a developer to export a base64 en-
codedstringthatrepresentstheCanvasdisplay,whichcanthenbeconvertedtoanimage.This
imageisrestrictedto96dpi.InHTML5.1,thisabilitywillbeexpandedtoincludeseveralnew
variations:
toDataURLHD()
Returns canvas data at native resolution instead of 96 dpi
toBlob()
toBlob()
Returns data as a blob at 96 dpi instead of a base64 encoded string
toBlobHD()
Returns data as a blob at native resolution
Search WWH ::




Custom Search