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);
- 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+绘制矩形渐变的更多相关文章
- asp.net GDI+绘制多个矩形
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- C# 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 ...
- C#GDI+ 绘制线段(实线或虚线)、矩形、字符串、圆、椭圆
C#GDI+ 绘制线段(实线或虚线).矩形.字符串.圆.椭圆 绘制基本线条和图形 比较简单,直接看代码. Graphics graphics = e.Graphics; //绘制实线 )) { pen ...
- Canvas 绘制矩形,圆形,不规则图形(线条),渐变等图像效果
绘制矩形: getContext("2d") 对象是内建的 HTML5 对象,拥有多种绘制路径.矩形.圆形.字符以及添加图像的方法. fillStyle 方法将其染成红色,fill ...
- 如何使用GDI绘制半透明矩形
/*使用GDI绘制半透明矩形*/ void CDirectXDraw::DrawHalfOpacityRect(HDC hdc,CRect rect) { CDC dc; dc.Attach(hdc) ...
- canvas 绘制矩形和圆形
canvas绘制有两神方法:1).填充(fill)填充是将图形内部填满. 2).绘制边框 (stroke)绘制边框是不把图形内部填满,只是绘制图形的外框. 当我们在绘制图形的时候,首先要设定好绘制的样 ...
随机推荐
- request.getParameterMap()使用方法
我习惯于加密完 重定向 : Map<String,String[]> getMap = request.getParameterMap(); String[] a = getMap.get ...
- linux之"server" directive is not allowed here in
配置完rewrite之后重启nginx发现如下错误 "server" directive is not allowed here in* 原因是因为 外部配置的simple.con ...
- [HNOI2008],[bzoj1008] 越狱(dp+组合数学)
题目传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1008 Description 监狱有连续编号为1...N的N个房间,每个房间关押一个犯人 ...
- CentOS 配置 iptables 配合 ss
转自:http://www.jianshu.com/p/28b8536a6c8a 环境: CentOS 6 shadowsocks iptables 在安装了ss-bash后,ss-bash每添加一次 ...
- Python 3 条件、循环和assert、pass、del
条件: if 条件: 语句块 elif: 语句块 else: 语句块 elif 表示 else if 这居然是合法的!!!1 < x < 2!!! >> ...
- 一些关于HTTP协议、表单和……的备忘
几个概念 Ajax是一种技术.asp.net是一个库.json是一种数据格式.jquery是js的库(源码).ror是ruby on rails.python,就是python.Ajax和AJAX,后 ...
- nodejs项目在webstorm里进行debug的设定
菜单 > Run > Edit Configurations... 菜单 > Run > Debug... 菜单 > Run > Edit Configuratio ...
- access数据库select查询top时无效的解决办法
access数据库select查询top时有时无效,原因就是在使用Order by时,且排序的条件中数据有重复的. 比如:select top 10 * from table1 order by cd ...
- SpringMVC学习系列(10) 之 异常处理
在项目中如何处理出现的异常,在每个可能出现异常的地方都写代码捕捉异常?这显然是不合理的,当项目越来越大是也是不可维护的.那么如何保证我们处理异常的代码精简且便于维护呢?这就是本篇要讲的内容—>异 ...
- HOG matlab练习
matlab练习程序(HOG方向梯度直方图) HOG(Histogram of Oriented Gradient)方向梯度直方图,主要用来提取图像特征,最常用的是结合svm进行行人检测. 算法流程图 ...