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 ...
随机推荐
- x-code快捷键
关于xcode 可设偏好设置 command+,清空缓存 可设隐藏xcode command+h隐藏其它 command+option+h显示全部 可设退出xcode command+q 文件相关: ...
- C#中的GDI+图形绘制方法
GDI+图形绘制方法 1.首先对于绘制图形,必须的先将命名空间导入:using System.Drawing.Drawing2D; 2.然后在一个事件中写入程序 首先先将Graphics这个对象实例化 ...
- 《C与指针》第七章练习
本章问题 1.具有空函数体的函数可以作为存根使用,你如何对这类函数进行修改,使其更有用? answer:Have the stub(存根) print out a message when it is ...
- 第二周PSP
PSP: C(分类) C(内容) S(开始时间) ST(结束时间) I(打断时间) △(净工作时间)(分钟) 读书 构建之法 18:00 19:25 0 85 读书 构建之法 9:30 11:20 1 ...
- 什么是FTP服务器
FTP服务器,则是在互联网上提供存储空间的计算机,它们依照FTP协议提供服务. FTP的全称是File Transfer Protocol(文件传输协议).顾名思义,就是专门用来传输文件的协议.简单地 ...
- centos6.4_安装Python3.5.2之问题
一.安装centos6.4虚拟机 这个就不用我详细介绍了,网上安装教程一大把了哈,自己百度安装应该没啥问题了 二.下载python安装包 官网下载python3.5.2安装包:https://www. ...
- linux 中printf的使用
linux 中printf的使用printf "helloworld\n"printf 中换行必须加上\n printf '%d %s\n' 1 "abc" c ...
- [solr] - 数据库导入
这里使用的是mysql测试. 1.先在mysql中建一个表:solr_test 2.插入几条测试数据: 3.用记事本打solrconfig.xml文件,在solrhome文件夹中.E:\solrhom ...
- gauss消元
题意描述:有n个星球,m台望远镜.每台望远镜有一个开始时间和结束时间,但只给出了月.日的信息,没有给出年份,每台望远镜记录了它所观测的星球上发生的各类事件的次数.每类事件持续的时间是恒定的,且不会超过 ...
- [家里蹲大学数学杂志]第049期2011年广州偏微分方程暑期班试题---随机PDE-可压NS-几何
随机偏微分方程 Throughout this section, let $(\Omega, \calF, \calF_t,\ P)$ be a complete filtered probabili ...