default.aspx.cs
来自「水晶报表详细资料水晶报表详细资料水晶报表详细资料」· CS 代码 · 共 39 行
CS
39 行
using System;
using System.Data;
using System.Configuration;
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.HtmlControls;
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(300, 150);
Graphics g = Graphics.FromImage(bitmap);
g.Clear(Color.WhiteSmoke);
GraphicsPath myGraphicsPath = new GraphicsPath();
Rectangle myRectangle = new Rectangle(20, 20, 80, 40);
myGraphicsPath.AddRectangle(myRectangle);
SolidBrush mySolidBrush1 = new SolidBrush(Color.Crimson);
g.FillPath(mySolidBrush1, myGraphicsPath);
Matrix myPathMatrix = new Matrix();
myPathMatrix.Scale(2, 1);
myPathMatrix.Rotate(10, MatrixOrder.Append);
myGraphicsPath.Transform(myPathMatrix);
SolidBrush mySolidBrush2 = new SolidBrush(Color.DarkOrange);
g.FillPath(mySolidBrush2, myGraphicsPath);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
Response.ClearContent();
Response.ContentType = "image/Gif";
Response.BinaryWrite(ms.ToArray());
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?