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. jdbc 配置

    jdbc 配置 Class.forName("com.mysql.jdbc.Driver")  ;//加载数据库驱动 Connection conn=null; String ur ...

  2. Linux之Qt利用Sqlite静态编译库(转)

    参考:http://www.linuxidc.com/Linux/2011-11/47465.htm sqlite3编译安装 ------------------------arm版--------- ...

  3. Maven项目

    1,创建项目,类似于创建一个VS.net 项目的 解决方案.    http://stackoverflow.com/questions/6328778/how-to-create-an-empty- ...

  4. Windows安装包制作指南——Advanced Installer的使用

    1. 前言 最近需要制作windows的安装包,据说Advanced Installer比较强大,遂拿它来制作安装包.在网上少量资料以及官网简约文档中摸索前进,总算是制作出可用的安装包,在此记录,仅供 ...

  5. mac osx 制作安装u盘

    制作OS X El Capitan 原版安装U盘:sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/creat ...

  6. OpenCV GPU CUDA OpenCL 配置

    首先,正确安装OpenCV,并且通过测试. 我理解GPU的环境配置由3个主要步骤构成. 1. 生成关联文件,即makefile或工程文件 2. 编译生成与使用硬件相关的库文件,包括动态.静态库文件. ...

  7. Android学习笔记(二)

    Google在Android4.0之后加入了Action Bar的功能.但是有时候标题栏会相当占用屏幕空间,使得内容区域变小,这里演示如何隐藏标题栏. 隐藏标题栏的方法很简单,打开上节的FirstAc ...

  8. [家里蹲大学数学杂志]第432期Hardy type inequalities

    If $p>1$, $f\geq 0$, and $$\bex F(x)=\int_0^x f(t)\rd t, \eex$$ then $$\bee\label{Hardy:0 to x} \ ...

  9. java io流(字符流) 文件打开、读取文件、关闭文件

    java io流(字符流) 文件打开 读取文件 关闭文件 //打开文件 //读取文件内容 //关闭文件 import java.io.*; public class Index{ public sta ...

  10. 关于AX 2012 SSRS 导出PDF时出现group by 分页错误的情况

    近期,在AX  2012 上一个二次开发的报表出现了一个奇怪的现象,报表设计正常,分组.分页设计正常, 但出现问题在,当报表在AX 上打开,按dataareaid 分页是正常的,如下图中title中的 ...