asp.net GDI+绘制折线

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Web;
 5 using System.Web.UI;
 6 using System.Web.UI.WebControls;
 7 using System.Drawing;
 8 using System.Drawing.Drawing2D;
 9
10 public partial class _Default : System.Web.UI.Page
11 {
12     protected void Page_Load(object sender, EventArgs e)
13     {
14         Bitmap bitmap = new Bitmap(260, 120);
15         Graphics graphics = Graphics.FromImage(bitmap);
16         graphics.Clear(Color.White);
17         Pen pen = new Pen(Color.Black, 3);
18         Point[] points = { new Point(10, 10), new Point(100, 100), new Point(200, 50), new Point(260, 120) };
19         graphics.DrawLines(pen, points);
20         System.IO.MemoryStream ms = new System.IO.MemoryStream();
21         bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
22         Response.ClearContent();
23         Response.ContentType = "image/Jpeg";
24         Response.BinaryWrite(ms.ToArray());
25     }
26 }

时间: 2024-10-24 04:24:24

asp.net GDI+绘制折线的相关文章

asp.net GDI+ 绘制椭圆 ,弧线,扇形

1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Web.UI; 6 using System.Web.UI.WebControls; 7 using System.Drawing; 8 using System.Drawing.Drawing2D; 9 10 public partial class _Default : Syst

asp.net GDI+绘制五边形

1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Web.UI; 6 using System.Web.UI.WebControls; 7 using System.Drawing; 8 using System.Drawing.Drawing2D; 9 10 public partial class _Default : Syst

asp.net GDI+绘制多个矩形

1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Web.UI; 6 using System.Web.UI.WebControls; 7 using System.Drawing; 8 using System.Drawing.Drawing2D; 9 10 public partial class _Default : Syst

asp.net GDI+绘制矩形渐变

1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Web.UI; 6 using System.Web.UI.WebControls; 7 using System.Drawing; 8 using System.Drawing.Drawing2D; 9 10 public partial class _Default : Syst

用canvas绘制折线图

1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>用canvas绘制折线图</title> 6 </head> 7 <body> 8 <canvas id="cv"></canvas> 9 </body> 1

Python中使用matplotlib 如何绘制折线图?

本文和大家分享的主要是python开发中matplotlib 绘制折线图相关内容,一起来看看吧,希望对大家学习和使用这部分内容有所帮助. matplotlib 1.安装matplotlib ① linux系统安装 # 安装matplotlib模块 $ sudo apt-get install python3-matplotlib# 如果是python2.7 执行如下命令 $ sudo apt-get install python-matplotlib# 如果你安装较新的Python,安装模块一乐

用鼠标左键绘制折线,利用鼠标中键或右键终止绘制

用鼠标左键绘制折线,同时在鼠标左键点中的位置输出一个含有该位置信息的字符串,利用鼠标中键或右键终止绘制. 解:建立一个Untitled.m文件 MATLAB指令: clf;axis([0,10,0,5]);hold on x=[];y=[]; for i=1:100 [x1,y1,button]=ginput(1); chstr=['(',num2str(x1),',',num2str(y1),')'];text(x1,y1,chstr); x=[x,x1];y=[y,y1];line(x,y)

使用GDI绘制验证码

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace 使用GDI绘制验证码B { public parti

Android自定义控件 -Canvas绘制折线图(实现动态报表效果)

有时候我们在项目中会遇到使用折线图等图形,Android的开源项目中为我们提供了很多插件,但是很多时候我们需要根据具体项目自定义这些图表,这一篇文章我们一起来看看如何在Android中使用Canvas绘制折线图.先看看绘制的效果: 代码: public class MyView extends View { //坐标轴原点的位置 private int xPoint=60; private int yPoint=260; //刻度长度 private int xScale=8;  //8个单位构