I am displaying images from a database using the code below.
Is there any way I can resize the images before rendering them?
public void showSelectedImage(string strEncodedImage)
{
Response.Clear();
Response.ContentType = "image/jpeg";
System.Drawing.Image image = retrieveImage(strEncodedImage);
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
private System.Drawing.Image retrieveImage(string strEncodedImage)
{
System.Drawing.Image image = null;
byte[] imageData = Convert.FromBase64String(strEncodedImage);
MemoryStream memStream = new MemoryStream(imageData);
image = System.Drawing.Image.FromStream(memStream);
return image;
}
Is there any way I can resize the images before rendering them?
public void showSelectedImage(string strEncodedImage)
{
Response.Clear();
Response.ContentType = "image/jpeg";
System.Drawing.Image image = retrieveImage(strEncodedImage);
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
private System.Drawing.Image retrieveImage(string strEncodedImage)
{
System.Drawing.Image image = null;
byte[] imageData = Convert.FromBase64String(strEncodedImage);
MemoryStream memStream = new MemoryStream(imageData);
image = System.Drawing.Image.FromStream(memStream);
return image;
}