To facilitate project printing, use GDI to draw a fully-coordinate system diagram and embed a PDF file.
As follows:
Generally, a coordinate chart only has 1/4 in the upper right corner. This graph is fully coordinate, and the input is the coordinates of four points, which can be negative values.
Code:
Code Bitmap bitmap = new Bitmap (this. Width, this. Height, PixelFormat. Format24bppRgb );
Graphics g = Graphics. FromImage (bitmap );
// Graphics g = this. CreateGraphics ();
G. Clear (Color. White );
Font font = new Font (Font. Name, 11 );
SolidBrush brush = new SolidBrush (Color. Black );
Pen pen = new Pen (Color. Black );
Pen. EndCap = LineCap. ArrowAnchor;
Pen. DashStyle = DashStyle. Solid;
// Coordinate axis
Point pCenter = new Point (300,260 );
G. DrawLine (pen, new Point (pCenter. X-200, pCenter. Y), new Point (pCenter. X + 200, pCenter. Y); // x
G. DrawLine (pen, new Point (pCenter. X, pCenter. Y + 200), new Point (pCenter. X, pCenter. Y-200); // y
// Axis mark
For (int I = 0; I <5; I ++)
{
G. drawLine (Pens. black, new Point (pCenter. x-iX * I, pCenter. y), new Point (pCenter. x-iX * I, pCenter. y-4); // x
G. DrawString (-I). ToString (), font, brush, new PointF (pCenter. X