OffscreenCanvas.convertToBlob()
Experimental
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
OffscreenCanvas.convertToBlob()
메소드는 캔버스에 포함된 이미지를 표현하는 Blob
객체를 생성합니다.
구문
Promise<Blob> OffscreenCanvas.convertToBlob(options);
매개 변수
options
Optional-
객체를
Blob
객체로 전환할 때 다양한 옵션을 줄 수 있습니다.const blob = offscreenCanvas.convertToBlob({ type: "image/jpeg", quality: 0.95 });
options:
반환 값
예시
var offscreen = new OffscreenCanvas(256, 256);
var gl = offscreen.getContext("webgl");
// ... gl 컨텍스트를 이용해 무언가를 그립니다 ...
offscreen.convertToBlob().then(function(blob) {
console.log(blob);
});
// Blob { size: 334, type: "image/png" }
상세
현재 작성되고 있는 중입니다: OffscreenCanvas.
브라우저 호환성
BCD tables only load in the browser
더 보기
- 이 메소드를 정의하는 인터페이스,
OffscreenCanvas
.