V
V
Vladimir2017-06-25 18:28:13
JavaScript
Vladimir, 2017-06-25 18:28:13

How to make the effect of movement, on the image, in the canvas'a window?

For example, I have a limited canvas, smaller width / height than the loaded image in it
Guys, how to make the effect of movement, on the image, in the canvas window? In other words, the canvas window does not change, but we "run" around the picture. Thank you.
fcbb7e2fd5164329b1f530d99d537587.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
twobomb, 2017-06-28
@vnam92

If I understand correctly , here's what happened .

T
TheLostRoot, 2017-06-26
@TheLostRoot

If you are talking about vertical and horizontal scrolling, then you can wrap the canvas in a div and give it a style:

.img_wrap {
width: 500px;
height: 250px;
overflow: hidden
}

But keep in mind that the maximum canvas size is limited. 32000 px in chrome it seems.
Or another way to catch mousemove with mousedown on the canvas and each time draw the picture anew by cropping it first through drawImage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question