VB.NET
Dim objBitmap As New Bitmap(500, 500)
Dim objGraphics As Graphics = Graphics.FromImage(objBitmap)
objGraphics.Clear(Color.White)
objGraphics.FillRectangle(New SolidBrush(Color.Purple), 0, 0, 400, 10)
objBitmap.Save(Response.OutputStream, ImageFormat.Jpeg)
C#
Bitmap objBitmap = new Bitmap(500, 500);
Graphics objGraphics = Graphics.FromImage(objBitmap);
objGraphics.Clear(Color.White);
objGraphics.FillRectangle(new SolidBrush(Color.Purple ), 0, 0, 400, 10);
objBitmap.Save(Response.OutputStream, ImageFormat.Jpeg);
Share with