keep the graphics

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sorry, is there any way that after we draw some line or graphics on the
windows form, after the windows minimized, the line and graphics won't
dissappear?

I'm appreciate for any reply, thank you
 
Jin,

When paint something on the form, the form doesn't remember what you
painted. Rather, when it needs to, the form repaints itself at regular
intervals.

What you need to do is store the information about where the line should
be drawn on your form. Then, call the Invalidate method on your form. When
you do that, it will cause a repaint. Then, from your form, you would
override the OnPaint method or sign up for the Paint event. Then, in these
methods, you would paint the line on your form according to the information
you stored.

Hope this helps.
 
I've done this before (with MFC but still applies here) by overriding
the OnPaint method, and blit a bitmap to the screen. If the user had
changed any of the application data i would need to re-render the
bitmap before letting OnPaint display it (instead it just showed a
rendering message). Bitmaps are a good way of caching if the drawing
process is intensive.

Hope this helps

Chris
 
Back
Top