jaheena jamal

jaheena jamal

  • NA
  • 83
  • 120.3k

bitmap image

Feb 18 2011 1:21 AM
This is the code for creating bitmap image in my web page. But these code contains error. But i don't know what is that?  




      int height = 100;
       int width = 200;
       Random r = new Random();
       int x = r.Next(75);
       Bitmap bmp = new Bitmap(width, height, PixelFormat.Format24bppRgb);
       Graphics g = Graphics.FromImage(bmp);
       g.SmoothingMode = SmoothingMode.AntiAlias;
       g.Clear(Color.Orange);
       g.DrawRectangle(Pens.Black, 1, 1, width - 3, height - 3);
       g.DrawRectangle(Pens.Red, 2, 2, width - 3, height - 3);
       g.DrawRectangle(Pens.Orange, 0, 0, width, height);
       g.DrawString("The code project", new Font("Arial", 12, FontStyle.Bold), SystemBrushes.WindowText, new Point(x, 50));


       bmp.Save(Response.OutputStream, ImageFormat.Gif);


       g.Dispose();
       bmp.Dispose();
       Response.End();




Answers (1)