I am reading an image from a database and writing it to the screen. But now I also need to put a border around this image. Here is my code :
public void showSelectedImage(string strEncodedImage)
{
Response.Clear();
Response.ContentType = "image/jpeg";
System.Drawing.Image image = retrieveImage(strEncodedImage);
System.Drawing.Image.GetThumbnailImageAbort dummyCallback;
dummyCallback = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
System.Drawing.Image thumb;
thumb = image.GetThumbnailImage(1200, 800, dummyCallback, IntPtr.Zero);
thumb.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
public bool ThumbnailCallback()
{
return false;
}
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 it possible to add a border to this image?
public void showSelectedImage(string strEncodedImage)
{
Response.Clear();
Response.ContentType = "image/jpeg";
System.Drawing.Image image = retrieveImage(strEncodedImage);
System.Drawing.Image.GetThumbnailImageAbort dummyCallback;
dummyCallback = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
System.Drawing.Image thumb;
thumb = image.GetThumbnailImage(1200, 800, dummyCallback, IntPtr.Zero);
thumb.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
public bool ThumbnailCallback()
{
return false;
}
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 it possible to add a border to this image?