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> 要素の height 属性と一致すべきですが、実装がリクエストされた高さを提供できない場合は異なるかもしれません。

数値です。

この <canvas> 要素があったとします。

html
<canvas id="canvas"></canvas>

以下の行で描画バッファーの高さを取得することができます。

js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
gl.drawingBufferHeight; // 150

仕様書

Specification
WebGL Specification
# DOM-WebGLRenderingContext-drawingBufferHeight

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
drawingBufferHeight

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報