asp.net GDI+绘制多个矩形
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+绘制多个矩形的更多相关文章
- asp.net GDI+绘制矩形渐变
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- asp.net GDI+ 绘制椭圆 ,弧线,扇形
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- asp.net GDI+绘制五边形
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- asp.net GDI+绘制折线
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- C#GDI+ 绘制线段(实线或虚线)、矩形、字符串、圆、椭圆
C#GDI+ 绘制线段(实线或虚线).矩形.字符串.圆.椭圆 绘制基本线条和图形 比较简单,直接看代码. Graphics graphics = e.Graphics; //绘制实线 )) { pen ...
- 如何使用GDI绘制半透明矩形
/*使用GDI绘制半透明矩形*/ void CDirectXDraw::DrawHalfOpacityRect(HDC hdc,CRect rect) { CDC dc; dc.Attach(hdc) ...
- C#利用GDI+绘制旋转文字等效果
C#中利用GDI+绘制旋转文本的文字,网上有很多资料,基本都使用矩阵旋转的方式实现.但基本都只提及按点旋转,若要实现在矩形范围内旋转文本,资料较少.经过琢磨,可以将矩形内旋转转化为按点旋转,不过需要经 ...
- MFC 用gdi绘制填充多边形区域
MFC 用gdi绘制填充多边形区域 这里的代码是实现一个三角形的绘制,并用刷子填充颜色 在OnPaint()函数里面 运用的是给定的三角形的三个点,很多个点可以绘制多边形 CBrush br(RGB( ...
- GDI+绘制图形和画刷填充图形
GDI+可以再Windows窗体应用程序中以编程方式绘制图形等. 可以在VS里新建项目-Windows窗体应用程序-建一个窗体.首先引入命名空间using System.Drawing.Imaging ...
随机推荐
- oracle中的装换函数
日期装换成字符的函数:TO_CHAR(date[,fmt[,params]]) 默认格式:DD-MON-RR 参数说明: date:将要装换的日期 fmt:装换的格式 params:日期的语言(可以不 ...
- libtcc使用问题一二
问题来由: powersniff(参考博客的文章,在qq群下载最新版本)目前使用lua作为分析插件,但熟练lua的人不多.所以,移植python和tcc两类语言作为插件. tcc(即tiny c),h ...
- 使用代理(WebProxy)爬虫
关键代码: private Hashtable hash;//储存代理ip private WebProxy currentdaili; private int dailiExecMaxCount; ...
- 解决php的“It is not safe to rely on the system’s timezone settings”问题
PHP调试的时候出现了警告: It is not safe to rely on the system解决方法,其实就是时区设置不正确造成的,本文提供了3种方法来解决这个问题. 实 际上,从PHP 5 ...
- 【转】STM32定时器输出比较模式中的疑惑
OCx与OCxREF和CCxP之间的关系 初学STM32,我这个地方卡了很久,现在终于有些明白了,现在把我的理解写下与大家共享,如果有不对的地方,还请指出. OCxREF就是一个参考信号,并且约定: ...
- [zz]计算 协方差矩阵
http://www.cnblogs.com/chaosimple/p/3182157.html http://blog.csdn.net/goodshot/article/details/86111 ...
- 【uTenux实验】邮箱
邮箱是一个通过在系统(共享)内存空间传递消息来实现同步和通信的对象.uTenux中每个邮箱都包含一个用来发送消息的消息队列和一个用于等待接收消息的任务队列,其使用邮箱功能的消息内容放置在发送方和接收方 ...
- JavaScript中的Array
Array类型是ECMAScript 用的最多的类型了,ECMAScript中的数组每一项可以保存任何类型的数据,也就是说,数组的第一个项保存字符串,用第二个保存数值,用第三个位置来保存对象.二千数据 ...
- RMAN_学习笔记5_RMAN Catalog Script恢复目录脚本
2014-12-24 Created By BaoXinjian
- WCF数据通讯
Windows Communication Foundation(WCF)是由微软发展的一组数据通信的应用程序开发接口,可以翻译为Windows通讯接口,它是.NET框架的一部分.由 .NET Fra ...