OffscreenCanvas.height

Baseline 2023

Newly available

Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

设置或者获取OffscreenCanvas 对象的高度。

语法

var pxl = offscreen.height;
offscreen.height = pxl;

例子

创建一个新的离屏 canvas,获取或者设置离屏 canvas 的高度:

js
var offscreen = new OffscreenCanvas(256, 256);
offscreen.height; // 256
offscreen.height = 512;

规范

Specification
HTML Standard
# dom-offscreencanvas-height-dev

浏览器兼容性

BCD tables only load in the browser

另外参阅