hi to all...
i save image path file in database (microsoft access)
i don't know how to command path file to displayed image on C#
who know, plz tell me
thank for your answer.
how can i display image in C#
Page 1 of 13 Replies - 1654 Views - Last Post: 08 March 2010 - 08:06 AM
Replies To: how can i display image in C#
#2
Re: how can i display image in C#
Posted 08 March 2010 - 03:44 AM
OpenFileDialog Class is one option to capture the file path.
Then your code might look like this
I did not test this code... just browsed some older syntax I have saved, so you might have to tweek it a little.
Then your code might look like this
Image img; string imgFile; OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = "c:\\"; //You are not limited to GIF or JPEG ofd.Filter = "Gif files (*.gif)|*.gif|JPEG Files(*.JPEG)|*.JPEG|All files (*.*)|*.*"; ofd.FilterIndex = 2; ofd.RestoreDirectory = true; imgFile = ofd.FileNames[0].ToString(); img = Image.FromFile(imgFile);
I did not test this code... just browsed some older syntax I have saved, so you might have to tweek it a little.
This post has been edited by Sn0wBum: 08 March 2010 - 07:58 AM
#3
Re: how can i display image in C#
Posted 08 March 2010 - 05:03 AM
Try looking at an picture box and then connect to your database to retrieve the path. You then just need to set the Image property of the picture box.
[rules][/rules]
[rules][/rules]
#4
Re: how can i display image in C#
Posted 08 March 2010 - 08:06 AM
You may also need to research byte array to image conversions.
*Note this link isn't to a D.I.C. source*
*Note this link isn't to a D.I.C. source*
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|