WebGLRenderingContext: drawingBufferWidth プロパティ
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.drawingBufferWidth
は読み取り専用のプロパティで、現在の描画バッファーの実際の幅を表します。これは、このコンテキストに関連付けられた <canvas>
要素の width
属性と一致すべきですが、実装がリクエストされた幅を提供できない場合は異なるかもしれません。
値
数値です。
例
この <canvas>
要素があったとします。
html
<canvas id="canvas"></canvas>
以下の行で描画バッファーの幅を取得することができます。
js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
gl.drawingBufferWidth; // 300
仕様書
Specification |
---|
WebGL Specification # DOM-WebGLRenderingContext-drawingBufferWidth |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
drawingBufferWidth |
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.