WebGLRenderingContext.drawingBufferHeight
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
WebGLRenderingContext.drawingBufferHeight
只读属性,指示当前绘图缓冲区的实际高度。它应当匹配与绘图上下文相关联的 <canvas>
元素的高度属性,如果实现未能提供所要求的高度,其值将有所不同。
语法
gl.drawingBufferHeight;
示例
指定 <canvas>
元素:
html
<canvas id="canvas"></canvas>
你可以通过下面几行代码来获取绘图缓冲区的高度:
js
var canvas = document.getElementById("canvas");
var gl = canvas.getContext("webgl");
gl.drawingBufferHeight; // 150
规范
Specification |
---|
WebGL Specification # DOM-WebGLRenderingContext-drawingBufferHeight |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
drawingBufferHeight |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.