Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
hi every one,below is the code to display image in the picture box and its running fine.
pictureBox1.ImageLocation = @"..\..\Resources\Images\" + dt.Rows[que]["Image_Name"].ToString();

i keep my images folder in Resources,when i make setup of this project and install this setup to other pc's everything is running fine but my images is not displaying.i also tried to move my images folder to outside of Resources folder it also not working.is there anyone who tell me how can i solve this issue.
Posted
Updated 16-Jul-11 20:37pm
v2
Comments
thatraja 17-Jul-11 2:52am    
Are you getting any errors? check your error log & tell us. I'm sure path is not matching.
ely_bob 17-Jul-11 19:03pm    
Is the image marked as copy to output?

1 solution

When an image, or other type of object, is embedded as a resources you can't access it as a normal path. This is working on your local system because the images are apparently located in the physical folder in that path. For a resources you must use the GetManifestResourceStream method

http://msdn.microsoft.com/en-us/library/aa287676(v=vs.71).aspx[^]
 
Share this answer
 
Comments
Espen Harlinn 17-Jul-11 19:55pm    
That would do the trick, my 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900