Hello, I am making a paint tool and so far so good. I have been able to make it draw lines, ellipses, and rectangles all based on mouse position. The only problem I am having now is when I resize the window, everything drawn on the canvas disappears. From what I understand, I should store the shapes I've drawn in a vector with their respective positions, and then somehow redraw them whenever the window has been resized. I've been struggling with this problem for couple of hours now and I can't seem to be able to do it on my own.
Here's the Canvas.h I've been given with the assignment:
So basically I am storing the starting point of each shape in the WM_LBUTTONDOWN case, tracking the ending point in the WM_MOUSEMOVE case, and then finally drawing it in the BUTTONUP case (which I know this isn't the place to draw it but I don't know where else I should do it!). I guess my question is, how can I possibly store the shapes along with their coordinates and re-draw them whenever the window has been resized?