using System;
using System.Drawing;
public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
tImage img = new tImage(200, 150, 300);
img.Clear(Color.White);
//
img.SetPen(Color.Black, 1);
img.SetBrush(Brushes.LightGray);
img.FillPolygon(new PointF[] {
new PointF(10,10),
new PointF(50,15),
new PointF(30,30)
});
img.DrawPolygon(new PointF[] {
new PointF(10,60),
new PointF(50,65),
new PointF(30,80)
});
// 输出
Response.ContentType = "image/png";
Response.AppendHeader("Content-Disposition",
"filename=img1.png;");
img.GetBitmap().Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Png);
}
}
|