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);
Rectangle rectangle = new Rectangle(, , , );
LinearGradientBrush mylineargradientbrush = new LinearGradientBrush(rectangle, Color.White, Color.Green, LinearGradientMode.ForwardDiagonal);
graphics.FillRectangle(mylineargradientbrush, , , , );
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. C# GDI绘制矩形框,鼠标左键拖动可移动矩形框,滚轮放大缩小矩形框

    最近工作需要,要做一个矩形框,并且 用鼠标左键拖动矩形框移动其位置.网上查了一些感觉他们做的挺复杂的.我自己研究一天,做了一个比较简单的,发表出来供大家参考一下.如觉得简单,可路过,谢谢.哈哈. 先大 ...

  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. asp.net GDI+绘制折线

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

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

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

  7. Canvas 绘制矩形,圆形,不规则图形(线条),渐变等图像效果

    绘制矩形: getContext("2d") 对象是内建的 HTML5 对象,拥有多种绘制路径.矩形.圆形.字符以及添加图像的方法. fillStyle 方法将其染成红色,fill ...

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

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

  9. canvas 绘制矩形和圆形

    canvas绘制有两神方法:1).填充(fill)填充是将图形内部填满. 2).绘制边框 (stroke)绘制边框是不把图形内部填满,只是绘制图形的外框. 当我们在绘制图形的时候,首先要设定好绘制的样 ...

随机推荐

  1. python学习笔记 ——python写的猜数字游戏 002

    from sys import exit import random def Arrfor(str): #CONTST = CONTST + 1 artificial = input("请输 ...

  2. position置顶或某固定位置 兼容ie6ie7

    用absolute来模拟fixed效果: /*相当于正常的position:fixed;top:0 */.sl_fixed_top{bottom:auto;top:0;_bottom:auto;_to ...

  3. 【C】 03 - 数据类型

    程序说到底就是对数据的处理,所以首先要弄清楚需要处理哪些数据,计算机如何存储这些数据.C语言根据需要,抽象出了一些基本数据类型和衍生数据类型.这些可以满足大部分需求,更复杂的抽象数据类型亦可通过它们来 ...

  4. 解决TalbleView头部或底部子控件不显示问题

    在自定义cell头部控件UITableViewHeaderFooterView(和自定义cell的方法几乎一样)时,出现了头部控件子控件不显示的问题. 注意和自定义cell的区别. .h文件 #imp ...

  5. codeforces 689 E. Mike and Geometry Problem 组合数学 优先队列

    给定一个函数: f([l,r]) = r - l + 1; f(空集) = 0; 即f函数表示闭区间[l,r]的整点的个数 现在给出n个闭区间,和一个数k 从n个区间里面拿出k个区间,然后对这k个区间 ...

  6. linux 文档处理命令

    1. 将用户信息数据库文件和组信息数据纵向合并为一个文件/1.txt(覆盖) 2.将用户信息数据库文件和用户密码数据库文件纵向合并为一个文件/2.txt(追加 3.将/1.txt./2.txt两个文件 ...

  7. [Linux] Linux下谁在消耗我们的cache

    一.缘由: 曾经看到MySQL服务器上Cache占用特别大,其实大家都知道这是合理的,这些都是可用内存: 那么问题来了,是谁在占用这些Cache呢?如果去掉不合理的Cache占用,系统内存会更充分的得 ...

  8. volley_之2

    一开始会不会觉得有点怔,为什么只需要将请求添加到队列中,不需要去发送请求吗?当然是要的,只是这一切都被封装在Volley后面而已. 我们先来看一下隐藏在Volley后面的这个架构是怎么样的吧,如下图: ...

  9. php创建多级目录的两种方法

    1.使用递归的思想 function mkdirs_2($path){ if(!is_dir($path)){ mkdirs_2(dirname($path)); if(!mkdir($path, 0 ...

  10. 慕课网-安卓工程师初养成-6-5 使用循环操作 Java 中的数组

    来源:http://www.imooc.com/code/1531 实际开发中我们经常使用循环控制数组成员的操作.如: 运行结果: 其中,  用于获取数组的长度 需要注意的“小毛病”: 1. 数组下标 ...