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. C#- 反射之 GetType()方法

    Type.GetType()在跨程序集反射时返回null的解决方法 在开发中,经常会遇到这种情况,在程序集A.dll中需要反射程序集B.dll中的类型.如果使用稍有不慎,就会产生运行时错误.例如使用T ...

  2. android之LayoutInflater讲解

    在实际工作中,事先写好的布局文件往往不能满足我们的需求,有时会根据情况在代码中自定义控件,这就需要用到LayoutInflater-->用来获得布局文件对象的. LayouInflater经常在 ...

  3. 深入理解AOP

    引子: AOP(面向方面编程:Aspect Oriented Programing)和IoC一样是Spring容器的内核,声明式事务的功能在此基础上开花结果.但是AOP和OOP差别较大,要很好地理解这 ...

  4. 10-Java 网络通信

    (一) Java中的XML操作 1.XML数据格式简介: (1)XML,即可扩展标记语言(Extensible Markup Language),标准通用标记语言的子集,一种用于标记电子文件使其具有结 ...

  5. JAVA_Java中关于supper和this的理解

    2015-04-04 Created By BaoXinjian

  6. Xamarin.Forms介绍

    On May 28, 2014, Xamarin introduced Xamarin.Forms, which allows you to write user-interface code tha ...

  7. Unity5版本的AssetBundle打包方案之打包Scene场景

    using UnityEngine; using System.Collections; using UnityEditor; /// <summary> /// 脚本位置:Editor文 ...

  8. mysql日志详细解析

    MySQL日志: 主要包含:错误日志.查询日志.慢查询日志.事务日志.二进制日志: 日志是mysql数据库的重要组成部分.日志文件中记录着mysql数据库运行期间发生的变化:也就是说用来记录mysql ...

  9. springmvc视图解析流程

    无论目标方法返回String.VIew或者是ModelAndView,springmvc都会转化成ModelAndView 然后通过视图解析器(如InternalResouceViewResolver ...

  10. Redis 数据结构使用场景

    转自http://get.ftqq.com/523.get 一.redis 数据结构使用场景 原来看过 redisbook 这本书,对 redis 的基本功能都已经熟悉了,从上周开始看 redis 的 ...