网上找了一个实时曲线类public class RealTimeMaker
有一个返回函数
public System.Drawing.Image GetCurrentCurve()
{
currentImage = new Bitmap(width, height);
Point p; for (int i = 0; i < width - 1; i++)
{
p = pointList[i + 1];
pointList[i] = new Point(p.X - 1, p.Y);
} Point tempPoint = new Point();
tempPoint.X = width;
tempPoint.Y = random.Next(DateTime.Now.Millisecond) % height; pointList[width - 1] = tempPoint;
Graphics g = Graphics.FromImage(currentImage);
g.Clear(backColor);
g.DrawLines(new Pen(foreColor),pointList);
g.Dispose();
return currentImage;
}怎么样能让绘制的图形显示到aspx页面
有一个返回函数
public System.Drawing.Image GetCurrentCurve()
{
currentImage = new Bitmap(width, height);
Point p; for (int i = 0; i < width - 1; i++)
{
p = pointList[i + 1];
pointList[i] = new Point(p.X - 1, p.Y);
} Point tempPoint = new Point();
tempPoint.X = width;
tempPoint.Y = random.Next(DateTime.Now.Millisecond) % height; pointList[width - 1] = tempPoint;
Graphics g = Graphics.FromImage(currentImage);
g.Clear(backColor);
g.DrawLines(new Pen(foreColor),pointList);
g.Dispose();
return currentImage;
}怎么样能让绘制的图形显示到aspx页面
有js画曲线的库,很不错
// Send the output to the client.
Response.Flush();
MemoryStream stream = new MemoryStream();
img.Save(stream, ImageFormat.Jpeg);
//图片输出
page.Response.Clear();
page.Response.ContentType = "image/jpeg";
page.Response.BinaryWrite(stream.ToArray());