Draw a bitmap image in asp.net

Ranjeet_8
Posted by Ranjeet_8 under ASP.NET category on | Points: 40 | Views : 2539
Draw a bitmap image in asp.net.
Add this namespace

using System.Drawing;
using System.Drawing.Imaging;

Write this code on ASPX.CS page

protected void Page_Load(object sender, EventArgs e)
{
Bitmap bitmapimg = new Bitmap(120, 120, PixelFormat.Format32bppArgb);
Graphics grph = Graphics.FromImage(bitmapimg);
SolidBrush br = new SolidBrush(Color.Green);
grph.FillEllipse(br, 4, 4, 110, 110);
Response.ContentType = "image/gif";
bitmapimg.Save(Response.OutputStream, ImageFormat.Gif);
bitmapimg.Dispose();
}

Comments or Responses

Login to post response