From d5f6dd6b7f6653facfb468516ef657a2d4d5180c Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 3 Jun 2021 01:40:04 +0000 Subject: [CRON] sync translated content --- .../web/api/offscreencanvas/toblob/index.html | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 files/ko/orphaned/web/api/offscreencanvas/toblob/index.html (limited to 'files/ko/orphaned/web/api/offscreencanvas') diff --git a/files/ko/orphaned/web/api/offscreencanvas/toblob/index.html b/files/ko/orphaned/web/api/offscreencanvas/toblob/index.html new file mode 100644 index 0000000000..f3cf0b08a9 --- /dev/null +++ b/files/ko/orphaned/web/api/offscreencanvas/toblob/index.html @@ -0,0 +1,78 @@ +--- +title: OffscreenCanvas.convertToBlob() +slug: orphaned/Web/API/OffscreenCanvas/toBlob +tags: + - API + - Canvas + - Experimental + - Method + - OffscreenCanvas + - Reference +translation_of: Web/API/OffscreenCanvas/toBlob +original_slug: Web/API/OffscreenCanvas/toBlob +--- +
{{APIRef("Canvas API")}} {{SeeCompatTable}}
+ +

OffscreenCanvas.convertToBlob() 메소드는 캔버스에 포함된 이미지를 표현하는 {{domxref("Blob")}} 객체를 생성합니다.

+ +

구문

+ +
Promise<Blob> OffscreenCanvas.convertToBlob(options);
+ +

매개 변수

+ +
+
options {{optional_inline}}
+
+

객체를 {{domxref("Blob")}} 객체로 전환할 때 다양한 옵션을 줄 수 있습니다.

+ +
const blob = offscreenCanvas.convertToBlob({
+  type: "image/jpeg",
+  quality: 0.95
+});
+ +

options:

+ +
    +
  • type: 이미지 포맷을 가리키는 {{domxref("DOMString")}}. 상세 타입은 image/png
  • +
  • quality: type 옵션이 image/jpeg 혹은 image/webp 일 때 이미지의 품질을 가리키는 01사이의 {{jsxref("Number")}}. 이 매개 변수가 다른 값이라면, 이미지 품질의 기본 설정값이 적용됩니다. 다른 매개 변수들은 무시됩니다.
  • +
+
+
+ +

반환 값

+ +

캔버스에 포함된 이미지를 표현하는 {{domxref("Blob")}} 객체를 반환하는 {{jsxref("Promise")}}

+ +

예시

+ +
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.

+ +

브라우저 호환성

+ +
+ + +

{{Compat("api.OffscreenCanvas.convertToBlob")}}

+
+ +

 

+ +

더 보기

+ + -- cgit v1.2.3-54-g00ecf