using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Drawing2D; public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Bitmap bitmap = new Bitmap(, );
Graphics graphics = Graphics.FromImage(bitmap);
graphics.Clear(Color.White);
Pen pen = new Pen(Color.Blue, );
Rectangle[] rects = { new Rectangle(, , , ), new Rectangle(, , , ), new Rectangle(, , , ) };
graphics.DrawRectangles(pen, rects);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
Response.ClearContent();
Response.ContentType = "image/Jpeg";
Response.BinaryWrite(ms.ToArray());
}
}

asp.net GDI+绘制多个矩形的更多相关文章

  1. asp.net GDI+绘制矩形渐变

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

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

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  3. asp.net GDI+绘制五边形

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  4. asp.net GDI+绘制折线

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  5. C#GDI+ 绘制线段(实线或虚线)、矩形、字符串、圆、椭圆

    C#GDI+ 绘制线段(实线或虚线).矩形.字符串.圆.椭圆 绘制基本线条和图形 比较简单,直接看代码. Graphics graphics = e.Graphics; //绘制实线 )) { pen ...

  6. 如何使用GDI绘制半透明矩形

    /*使用GDI绘制半透明矩形*/ void CDirectXDraw::DrawHalfOpacityRect(HDC hdc,CRect rect) { CDC dc; dc.Attach(hdc) ...

  7. C#利用GDI+绘制旋转文字等效果

    C#中利用GDI+绘制旋转文本的文字,网上有很多资料,基本都使用矩阵旋转的方式实现.但基本都只提及按点旋转,若要实现在矩形范围内旋转文本,资料较少.经过琢磨,可以将矩形内旋转转化为按点旋转,不过需要经 ...

  8. MFC 用gdi绘制填充多边形区域

    MFC 用gdi绘制填充多边形区域 这里的代码是实现一个三角形的绘制,并用刷子填充颜色 在OnPaint()函数里面 运用的是给定的三角形的三个点,很多个点可以绘制多边形 CBrush br(RGB( ...

  9. GDI+绘制图形和画刷填充图形

    GDI+可以再Windows窗体应用程序中以编程方式绘制图形等. 可以在VS里新建项目-Windows窗体应用程序-建一个窗体.首先引入命名空间using System.Drawing.Imaging ...

随机推荐

  1. Sublime Text 2 配置

    设置Python的Tab缩进为四个空格,打开一个Py文件 # Preferences---->Settings-More---->Syntax Specific-User # 贴入如下代码 ...

  2. cache是什么文件?

    通常人们所说的Cache就是指缓存SRAM. SRAM叫静态内存,"静态"指的是当我们将一笔数据写入SRAM后,除非重新写入新数据或关闭电源,否则写入的数据保持不变. 由于CPU的 ...

  3. 传递引用类型参数的两种方式(转自 MSDN)

    引用类型的变量不直接包含其数据:它包含的是对其数据的引用.当通过值传递引用类型的参数时,有可能更改引用所指向的数据,如某类成员的值(更改属性的值),但是无法更改引用本身的值:也就是说,不能使用相同的引 ...

  4. CentOS 7 安装 Oracle 11g

    新到的云主机环境,系统是CentOS 7 x86_64,需要安装上安装Oracle11.2g.摸索很长时间,终于折腾搞定了. 下载 Oracle 下载地址:Oracle 11.2.0.2 (因为不是已 ...

  5. How to relocate tablespace directory

    I’ll demonstrate how to relocate a tablespace directory without the reconstruction of databases. I h ...

  6. 封装对NPOIExcel的操作,方便的设置导出Excel的样式

    下载: http://pan.baidu.com/s/1boTpT5l 使用方法: 导入: 使用 ReadToDataTable方法 导出: NPOIExcel.ExcelManager manger ...

  7. windbg

    1, symbols  : srv*c:\symbols*http://msdl.microsoft.com/download/symbols 2,.loadby sos mscorwks  or   ...

  8. ORA-12154: TNS:could not resolve the connect identifier specified

    场景: .Net程序无法连接到数据库 现象: 2015/8/26 11:02:03 ORA-12154: TNS:could not resolve the connect identifier sp ...

  9. centos7优化mysql5.6配置

    一.环境参数 [root@hn mysql]# grep 'physical id' /proc/cpuinfo |sort -u physical id : 0 physical id : 1 [r ...

  10. 在windows上安装scikit-learn开发环境

    操作系统:Windows 10 64位 1.安装python 前往https://www.python.org/downloads/下载对应操作系统的版本,笔者下载了32位的python 2.7.13 ...