showing an image which has been saved in SQL server
-
-
Hi I have problem to how could I show an image file which has been saved in db in my pages. I mean I have an image file that has been saved in db and I want to load it in my page. I search articles and I found nothing ! I appreciate your help Regrads
-
Hi I have problem to how could I show an image file which has been saved in db in my pages. I mean I have an image file that has been saved in db and I want to load it in my page. I search articles and I found nothing ! I appreciate your help Regrads
-
Hi there, Use this link...hope it might solve your problem http://www.codeproject.com/cs/database/albumviewer.asp You can use System.IO namespace to solve your problem.
Thanks But you know when I am using asp.net there was a problem that only I can use imgeurl in my asp:Image control and I can not address the Image which reside on memory. I kind I have a solution by using a proxy page but that is kind of hard. And I thing there might be a better solution like that which we use in Windows Applications Like in example : Bitmap bmp1 = new Bitmap(bmp, new Size(500,300)); pictureBox.Image = bmp1; if any other usefull urls or suggestions please tell me
-
Thanks But you know when I am using asp.net there was a problem that only I can use imgeurl in my asp:Image control and I can not address the Image which reside on memory. I kind I have a solution by using a proxy page but that is kind of hard. And I thing there might be a better solution like that which we use in Windows Applications Like in example : Bitmap bmp1 = new Bitmap(bmp, new Size(500,300)); pictureBox.Image = bmp1; if any other usefull urls or suggestions please tell me
Hi there, In this case, you simply create a seperate page, say ShowImage.aspx, which is mainly used to display the image. Then you can assign this page to the Image.ImageUrl property:
Image1.ImageUrl = "ShowImage.aspx";
The sample code to read the image in the ShowImage.aspx looks something like:
private void Page_Load(object sender, System.EventArgs e)
{
Bitmap bmp1 = CreateBitmapInstance();bmp1.Save(Response.OutputStream, ImageFormat.Gif); bmp1.Dispose();
}
private Bitmap CreateBitmapInstance()
{
//You code here to create a bitmap instance from the image data saved in DB.
} -
Thanks But you know when I am using asp.net there was a problem that only I can use imgeurl in my asp:Image control and I can not address the Image which reside on memory. I kind I have a solution by using a proxy page but that is kind of hard. And I thing there might be a better solution like that which we use in Windows Applications Like in example : Bitmap bmp1 = new Bitmap(bmp, new Size(500,300)); pictureBox.Image = bmp1; if any other usefull urls or suggestions please tell me
Masud the suggestion as given by minhpc_bk is the most accepted solution so far for displaying images from memory. Also, if it is not a burden on your server than you can also store the image from memory to some location on server and apply that path to the ImageUrl.