How to implement Undo in a drawing program?

You are creating a paint program such as Paint. You want to be able to undo / red brush strokes. How do you implement this?

Optimize speed and memory.

+3
source share
2 answers

Use quadtree to record the previous state of the changed part of the canvas. When canceling, replace the canvas state from the quadrant.

+2
source

. , . , , , . .

.

0

Source: https://habr.com/ru/post/1716266/


All Articles