You really should do a little reading for yourself.
You seem to want to know what a
Graphics
object is and what it does. So take a look at the documentation
here[
^].
Put very simply a
Graphics
is a class that enables you to draw on a
Bitmap
or
Control
.
Your first code sample should work but will be comparatively slow. If possible you should replace it with something like
using (Graphics g = Graphics.FromImage(BufferImage))
{
g.Clear(Colors.White);
}
which will be far quicker.
The
e.Graphics
in the second snippet is a Graphics object that will do all its drawing on
DrawingPanel1
whatever sort of control that is (I assume a
Panel
)
For
DrawImage
, why not read it for yourself from the link I gave you earlier? You will learn far more that way.