Using SolidBrush monochrome brushes
Bitmap Bitmap = new Bitmap (800, 600);
Graphics graphics = graphics.fromimage (bitmap);
Graphics. Clear (Color.White);
SolidBrush Mysolidbrush = new SolidBrush (color.yellow);
Graphics. FillEllipse (Mysolidbrush, 70, 20, 100, 50);
System.IO.MemoryStream ms = new System.IO.MemoryStream ();
Bitmap. Save (MS, SYSTEM.DRAWING.IMAGING.IMAGEFORMAT.GIF);
Response.clearcontent ();
Response.ContentType = "Image/gif";
Response.BinaryWrite (Ms. ToArray ());
IMG derived class object, canvas, clean canvas, declaration brush---draw ellipse--put IMG into memory stream--binary array sent from server to browser
Draw a simple pattern with HatchBrush
Bitmap Bitmap = new Bitmap (200, 100);
Graphics graphics = graphics.fromimage (bitmap);
Graphics. Clear (Color.White);
HatchBrush Myhatchbrush = new HatchBrush (hatchstyle.backwarddiagonal, Color.green, Color.orange);
Graphics. FillEllipse (myhatchbrush, 0, 0, 200, 100);
System.IO.MemoryStream ms = new System.IO.MemoryStream ();
Bitmap. Save (MS, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.clearcontent ();
Response.ContentType = "Image/jpeg";
Response.BinaryWrite (Ms. ToArray ());
IMG derived class object, canvas, clean canvas, declaration brush---draw ellipse--put IMG into memory stream--binary array sent from server to browser
GDI + (Graphics Device Interface) Example