asp.net GDI+把图片绘制成自定义的椭圆形状

时间:2021-12-21 16:17:01
 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 g = Graphics.FromImage(bitmap);
g.Clear(Color.White);
TextureBrush mytextbrush = new TextureBrush(System.Drawing.Image.FromFile(Server.MapPath("~/images/001aa.jpg")));
g.FillEllipse(mytextbrush,,,,);
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+把图片绘制成自定义的椭圆形状