G. drawrectangle (new pen (color. White, 400), 0, 0, IMG. Width, IMG. Height );
// Define the black transition paint brush
Lineargradientbrush brush = new lineargradientbrush (New rectangle (0, 0, IMG. Width, IMG. Height), color. Black, color. Black, 1.2f, true );
// Define the blue transition paint brush
Lineargradientbrush bluebrush = new lineargradientbrush (New rectangle (0, 0, IMG. Width, IMG. Height), color. Blue, color. Blue, 1.2f, true );
// Draw a large title
G. drawstring (Ds. tables [0]. rows [0] ["sendid"]. tostring () + "number order delivery curve", bfont, brush, 40, 5 );
// Obtain the current sending volume
Int Nums = 0;
For (INT I = 0; I <count; I ++)
{
Nums + = convert. toint32 (Ds. Tables [0]. Rows [I] ["sendnum"]);
}
// Create an information briefing
String info = "order sending time:" + Ds. tables [0]. rows [0] ["sendtime"]. tostring () + "Graph Generation Time:" + datetime. now. tostring () + "total orders:" + tnum. tostring () + "Total number of sent messages:" + nums. tostring ();
G. drawstring (Info, tfont, bluebrush, 40, 25 );
// Draw the image border
G. drawrectangle (BP, 0, 0, IMG. Width-1, IMG. Height-1 );
// Draw the vertical coordinate line
For (INT I = 0; I <count; I ++)
{
G. drawline (SP, 40 + 20 * I, 60, 40 + 20 * I, 360 );
}
// Draw the timeline coordinate tag
For (INT I = 0; I <count; I + = 2)
{
String ST = convert. todatetime (Ds. Tables [0]. Rows [I] ["sendtime"]). tostring ("HH: mm ");
G. drawstring (St, Font, brush, 30 + 20 * I, 370 );
}
// Draw the abscissa line
For (INT I = 0; I <10; I ++)
{
G. drawline (SP, 40, 60 + 30 * I, 40 + 20 * (count-1), 60 + 30 * I );
Int S = 2500-50 * I * 5;
// Draw the dispatch axis coordinate label
G. drawstring (S. tostring (), Font, brush, 10, 60 + 30 * I );
}
// Draw the vertical axis
G. drawline (BP, 40, 55, 40,360 );
// Draw the horizontal axis
G. drawline (BP, 40,360, 45 + 20 * (count-1), 360 );
// Define the curve turning point
Point [] P = new point [count];
For (INT I = 0; I <count; I ++)
{
P [I]. x = 40 + 20 * I;
P [I]. Y = 360-convert. toint32 (Ds. Tables [0]. Rows [I] ["sendnum"])/5*3/5;
}
// Draw the sending Curve
G. drawlines (RP, P );
For (INT I = 0; I <count; I ++)
{
// Draw the number of sending records
G. drawstring (Ds. tables [0]. rows [I] ["sendnum"]. tostring (), Font, bluebrush, P [I]. x, p [I]. y-10 );
// Draw the sending Record Point
G. drawrectangle (RP, P [I]. X-1, P [I]. Y-1, 2, 2 );
}
// Draw the vertical coordinate title
G. drawstring ("sent volume", tfont, brush, 5, 40 );
// Draw the abscissa title
G. drawstring ("sending time", tfont, brush, 40,385 );
// Save the drawn Image
Memorystream stream = new memorystream ();
IMG. Save (stream, imageformat. JPEG );
// Image output
Page. response. Clear ();
Page. response. contenttype = "image/JPEG ";
Page. response. binarywrite (stream. toarray ());
}
}