S
Sherif ElMetainy
Hello
if you already have an image file somewhere
string filaname = "C:\myimage.png");
Response.ContentType = "image/png";
Response.WriteFile(filaname);
Response.End();
Or if you want to generate the image dynamically
int width = 400, height = 300; // 400 * 300 image
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(width, height);
// Do some drawing with the bmp object ...
Response.ContentType = "image/png";
bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png);
Response.End();
Best regards,
Sherif
if you already have an image file somewhere
string filaname = "C:\myimage.png");
Response.ContentType = "image/png";
Response.WriteFile(filaname);
Response.End();
Or if you want to generate the image dynamically
int width = 400, height = 300; // 400 * 300 image
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(width, height);
// Do some drawing with the bmp object ...
Response.ContentType = "image/png";
bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png);
Response.End();
Best regards,
Sherif