From a68152ef9cd653f92705683592d4652b617ab02c Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 27 Oct 2021 13:49:02 +0300 Subject: [RU] Fix another live samples (#2879) --- files/ru/web/api/canvasrenderingcontext2d/getimagedata/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'files/ru/web/api/canvasrenderingcontext2d/getimagedata') diff --git a/files/ru/web/api/canvasrenderingcontext2d/getimagedata/index.html b/files/ru/web/api/canvasrenderingcontext2d/getimagedata/index.html index 08fffcc737..963d67e340 100644 --- a/files/ru/web/api/canvasrenderingcontext2d/getimagedata/index.html +++ b/files/ru/web/api/canvasrenderingcontext2d/getimagedata/index.html @@ -52,19 +52,19 @@ translation_of: Web/API/CanvasRenderingContext2D/getImageData

HTML

-
<canvas id="canvas"></canvas>
+
<canvas id="canvas"></canvas>

JavaScript

The object retrieved by getImageData() has a width of 200 and a height of 100, for a total of 20,000 pixels. Of those pixels, most are either transparent or taken from off the canvas; only 5,000 of them are opaque black (the color of the drawn rectangle).

-
const canvas = document.getElementById('canvas');
+
const canvas = document.getElementById('canvas');
 const ctx = canvas.getContext('2d');
 ctx.rect(10, 10, 100, 100);
 ctx.fill();
 
 let imageData = ctx.getImageData(60, 60, 200, 100);
-ctx.putImageData(imageData, 150, 10);
+ctx.putImageData(imageData, 150, 10);

Result

-- cgit v1.2.3-54-g00ecf