IW1QLH

  • Increase font size
  • Default font size
  • Decrease font size

Generate a JPEG image

E-mail Print PDF
ASPX.CS C# - How to generate dinamically a image

protected void Page_Load(object sender, EventArgs e)
{
    // create a Graphics object
    Bitmap bmp = new Bitmap(745, 570);
    Graphics g = Graphics.FromImage(bmp);

    // now draw on the Graphics object
    SolidBrush b = new SolidBrush(Color.FromArgb(191, 191, 191));
    g.FillRectangle(b, new Rectangle(0, 0, bmp.Width, bmp.Height));

    // send the image as response
    bmp.Save(Response.OutputStream, ImageFormat.Jpeg);

}

{moscomment}

Last Updated on Friday, 27 October 2006 16:01