G
G
Golickoff2019-05-25 19:51:44
JavaScript
Golickoff, 2019-05-25 19:51:44

Is it possible to expand an image in a canvas?

Hello.
Is there a mechanism in js that allows you to expand the image in the canvas like in the picture below, where red shows the padding and black shows the borders of the canvas?
5ce9722a9768d869069684.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
twobomb, 2019-06-02
@Golickoff

I threw an example through getImageData, putImageData.
PS If you render images, they must be on your domain in order not to run into the Access-Control-Allow-Origin problem

F
forspamonly2, 2019-05-25
@forspamonly2

draw the two halves in turn. drawImage has additional parameters that specify which part of the image to draw.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question