public partial class DisplayImageThumbnail : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { String imageId= Request.QueryString["imageId"]; imageId = imageId?? "-1"; Bitmap image; try { // get data contract containing image from service CustomImage csImg = ImageInteraction.GetImageById(imageId); image = csImg.ImageData; } catch { // show a 'no image' image in case of error or n/a image = (Bitmap)Bitmap.FromFile(Server.MapPath(String.Format("../Images/no_image.jpg")); } // will render blank if no image. Response.ContentType = "image/jpeg"; image.Save(Response.OutputStream, ImageFormat.Jpeg); } }
Simple little method once I figured it out, but it seemed like it might help someone else in a similar situation.
Hi there! I'm at work browsing your blog from my new iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the fantastic work!
ReplyDeleteFeel free to visit my homepage potentiometers