asp.net 图片 画线
Bitmap srcImg = new Bitmap(300, 300); //也可以读入一张图片
Graphics graphics = Graphics.fromImage(srcImg);
Font font = new Font("宋体", 16); //字体与大小
Brush brush = new SolidBrush(Color.Red);
graphics.DrawString("www.cftea.com", font, brush, 50, 50); //写字,最后两个参数表示位置
Pen pen = new Pen(Color.fromArgb(33, 66, 99), 10); //颜色与宽度
Point[] pts = new Point[3]; //曲线的点
pts[0] = new Point(120, 130);
pts[1] = new Point(140, 280);
pts[2] = new Point(200, 100);
graphics.DrawCurve(pen, pts); //画曲线
srcImg.Save(Server.MapPath("example.jpg"));
graphics.Dispose();
srcImg.Dispose();
相关文档:
在不同版本的 IIS 上使用 ASP.NET MVC
ASP.NET MVC Framework 依赖于 URL 路由。为了利用 URL 路由,可能不得不在 Web 服务器上执行额外的配置步骤。这些步骤取决于 Internet Information Services (IIS) 的版本和应用程序的请求处理模式。
IIS 的最新版本是版本 7.0。IIS 的此版本包括在 Windows Server 2008 中。还可以 ......
asp.net(C#)实现SQL2000数据库备份和还原
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.Htm ......
URL 重写是截取传入 Web 请求并自动将请求重定向到其他 URL 的过程。
比如浏览器发来请求hostname/101.aspx ,服务器自动将这个请求中定向为http://hostname/list.aspx?id=101。
url重写的优点在于:
缩短url,隐藏实际路径提高安全性
易于用户记忆和键入。
&nbs ......
1.获取图片宽度和高度
1.您可以使用 System.Drawing.Image 类
System.Drawing.Image img = System.Drawing.Image.fromFile(Server.MapPath("example.gif"));
int width = img.Width;
int height = img.Height;
img.Dispose();
但是这里我们却不能在导入名称空间后使用 Image& ......
关于&、双引号、和单引号的解释
下面先简单地说一下他们的意义。
(1)&是连接运算符,它可以将两个字符串连接成一个字符串。如
a="abc" & "def"
执行连接运算后,a="abcdef ......