Changes

Jump to: navigation, search

Drawing Graphics in C Sharp

6 bytes removed, 18:33, 30 January 2008
Persistent Graphics
== Persistent Graphics ==
An important point to note before proceeding with is chapter is that simply creating a Graphics Object for a component and they then drawing on that component does not create persistent graphics. In fact what will happen is that as soon as the window is minimized, or obscured by another window the graphics will be erased.
For this reason, steps need to be taken to ensure that any graphics are persistent. Two mechanisms are available for achieving this. One is to repeatedly perform the drawing in the ''Paint()'' event handler of the control (which is triggered whenever the component needs to be redrawn), or to perform the drawing on a bitmap image in memory and then transfer that image to the component whenever the ''Paint()'' event is triggered. We will look at using redrawing the graphics in the ''Paint()'' event in this chapter and [[Using Bitmaps for Persistent Graphics in C Sharp|Using Bitmaps for Persistent Graphics in C#]] in the next chapter.
== Creating a Graphics Object ==

Navigation menu