1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingsystem.web;5 usingSystem.Web.UI;6 usingSystem.Web.UI.WebControls;7 usingSystem.Drawing;8 usingSystem.Drawing.Drawing2D;9 Ten Public Partial class_default:system.web.ui.page One { A protected voidPage_Load (Objectsender, EventArgs e) - { -Bitmap Bitmap =NewBitmap ( -, $); theGraphics g =graphics.fromimage (bitmap); - g.clear (color.white); -TextureBrush Mytextbrush =NewTextureBrush (System.Drawing.Image.FromFile (Server.MapPath ("~/images/001aa.jpg"))); -G.fillellipse (Mytextbrush,0,0, -, $); +System.IO.MemoryStream ms=NewSystem.IO.MemoryStream (); - bitmap. Save (ms,system.drawing.imaging.imageformat.jpeg); + response.clearcontent (); AResponse.ContentType ="Image/jpeg"; at Response.BinaryWrite (Ms. ToArray ()); - } -}
ASP. NET GDI + draws the picture into a custom oval shape