GDI service is divided into the following three categories:
Two-dimensional vector graphics
Image Processing
format
When GDI is dealt, it is actually built, and then draws a graphic frame on the canvas, followed by filling something in the frame, and finally the release of the resource is an example of a pie chart. Using system; use system.collections; ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web. Ui.WebControls; use system.web.ui.htmlcontrols;
A summary description of Namespace gditest {///
INT Piewidth = 120, Pieheight = 40, pieshadow = 15; int [] arrvote = {70, 90, 80, 20, 60, 40}; Random Oran = New Random ();
Bitmap objBitmap = new Bitmap (width-100, height-100); Graphics objGraphics = Graphics.FromImage (objBitmap); objGraphics.DrawRectangle (new Pen (Color.Black), 0,0, width-100, height-100); objGraphics.FillRectangle (new SolidBrush (Color.White), 1, 1, width - 2, height - 2); SolidBrush objBrush = new SolidBrush (Color.Blue); objGraphics.SmoothingMode = SmoothingMode.AntiAlias; int iCurrentPos = 0;
Color [] Arrcolor = {Color.red, Color.red, Color.Red, Color.Red, Color.Red, Color.red};
For (int i = arrvote.length - 1; i> = 0; I -) {Arrcolor [i] = color.fromargb (ORAN.NEXT (255), ORAN.NEXT (255) }
For (int i = arrvote.length - 1; i> = 0; I -) {objbrush.color = arrcolor [i]; for (int iLoop2 = 0; iLoop2
Objbitmap.save (response.outputstream, imageformat.jpeg); // clean Up ... Objgraphics.dispose (); objbitmap.dispose ();
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///
} #Endregion}}}