大话西游台词截图高清:c#画图
1 //描绘曲线
//创建曲线中的点
Point point1 = new Point(68, 420);Point point2 = new Point(71, 410);
Point point3 = new Point(74, 423);
Point point4 = new Point(77, 412);
Point point5 = new Point(80, 400);
Point point6 = new Point(90, 380);
Point point7 = new Point(100, 350);
Point point8 = new Point(120, 320);
Point[] curvePoints = { point1, point2, point3, point4, point5, point6, point7, point8 };
GraphicsPath myPath = new GraphicsPath();
//AddCurve(点阵,起点,终点,弯曲程度)
myPath.AddCurve(curvePoints, 0, 7, 0.8f);
Pen myPen = new Pen(Color.Red, 1);
IMG.DrawPath(myPen, myPath);
---------------------------------------------------------------------------------------------
2 c#.net画曲线图(坐标)
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
//数据/月份
public ArrayList arrData=new ArrayList();
public ArrayList arrMonth=new ArrayList();
//定义幕布高宽
private int iCanvasWidth=400;
private int iCanvasHeight=300;
//x轴的间距
private int iX=30;
//y轴间距
private int iY=15;
public void InitArray()
{
for(int i=0;i<6;i++)
arrMonth.Add(i+1);
arrData.Add(200);
arrData.Add(180);
arrData.Add(285);
arrData.Add(290);
arrData.Add(275);
arrData.Add(350);
}
// //pen 画线
// Pen myPen = new Pen(Color.Black);
// Graphics g = this.CreateGraphics();
// g.DrawEllipse(myPen, 20, 30, 10, 50);
//
// Graphics g1 = this.CreateGraphics();
// SolidBrush myBrush = new SolidBrush(Color.Red);
// g1.FillEllipse(myBrush,20,30,40,40);
// g1.FillRectangle(myBrush,70,70,10,30);
this.InitArray();
Bitmap bitmap= new Bitmap(iCanvasWidth, iCanvasHeight,PixelFormat.Format24bppRgb);
//Graphics g=Graphics.FromImage(bitmap);
Graphics g=this.CreateGraphics();
g.Clear(Color.White);
Font font = new Font("MS UI Gothic",12);
SolidBrush brush = new SolidBrush(Color.Black);
Pen pen = new Pen(Color.Black);
pen.EndCap = LineCap.ArrowAnchor;
pen.DashStyle = DashStyle.Solid;
//坐标轴
g.DrawLine(pen,20,220,420,220);
g.DrawLine(pen,20,220,20,20);
//x轴标格
g.DrawLine(Pens.Black,20+iX*1,220,20+iX*1,220-2);
g.DrawLine(Pens.Black,20+iX*2,220,20+iX*2,220-2);
g.DrawLine(Pens.Black,20+iX*3,220,20+iX*3,220-2);
g.DrawLine(Pens.Black,20+iX*4,220,20+iX*4,220-2);
g.DrawLine(Pens.Black,20+iX*5,220,20+iX*5,220-2);
g.DrawLine(Pens.Black,20+iX*6,220,20+iX*6,220-2);
//y轴标格
g.DrawLine(Pens.Black, 20, 220 - iY*1, 20 + 2, 220 - iY*1);
g.DrawLine(Pens.Black, 20, 220 - iY*2, 20 + 2, 220 - iY*2);
g.DrawLine(Pens.Black, 20, 220 - iY*3, 20 + 2, 220 - iY*3);
g.DrawLine(Pens.Black, 20, 220 - iY*4, 20 + 2, 220 - iY*4);
g.DrawLine(Pens.Black, 20, 220 - iY*5, 20 + 2, 220 - iY*5);
g.DrawLine(Pens.Black, 20, 220 - iY*6, 20 + 2, 220 - iY*6);
//
double dblX1=20;
double dblY1=220;