How to make the effect of the infinite canvas?

Found a way, the canvas is increased in the event handler for scrolling the value scroll. If there's any other option poizyaschnee?
April 7th 20 at 15:32
2 answers
April 7th 20 at 15:34
Take the canvas larger than the screen up to double height and width.
When you move the canvas is scrolled. Once you get to the border - add with the new canvas of the same size. Both move the canvas while the first will not be out of sight and you can safely delete.
In this approach, two are enough canvases if you have moved on one axis, and four if you move on two axes.
April 7th 20 at 15:36
You can imagine that googlecart - infinite canvas. But it's not a giant picture, it's a bunch of small pictures. Then just need to finish the right pieces after scrolling.
  1. Make a two-dimensional array of symbols (or list of lists of symbols so that the number can easily be changed). The size of the images can be anything, as more of the size of the canvas and less. For example, the size of one picture 100x100
  2. Put pictures on canvas. For example, the canvas size to 500x500, then put 25 images in the array. Perhaps to complement the edges of another picture, that is, make the canvas size 600x600 (or even 700x700), but show only the center
  3. Disable standard scrollbar of the canvas and scroll to do it yourself - drag the mouse (you can click the right button, or customize and scroll mice). Because the scrollbar shows where is the viewing window in General document, but in the infinite canvas it doesn't make sense
  4. When you scroll the canvas to check, what happened to the part where there are no images, then remove the last row or column to finish a new row or column of the array.
  5. When drawing images from the array, change the scroll of the canvas to return the canvas to the center, there will need pictures after deleting some pictures

Find more questions by tags AlgorithmsC#Windows Forms