Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
Hello all,

I have a image file in myProject Resource(i.e., Properties.Resources.ch))
i want to get path of this file

pls help me i am new in c#

-Thank you

-tushar
Posted
Comments
Sergey Alexandrovich Kryukov 22-Oct-14 10:28am    
Why? Using image resources is simpler that that. :-)
What you write in your example is not a path.
—SA

The file doesn't exist at runtime, so your question doesn't make any sense.

Resource files are compiled into structures into the resulting executable. There is no file to get the path to!
 
Share this answer
 
you can access them as below
C#
System.Drawing.Bitmap bitmap1 = myProject.Properties.Resources.Image01;

if you need to get the path, check below answer
http://stackoverflow.com/a/14265535/2558060[^]
 
Share this answer
 
v2
Comments
TusharZoo 22-Oct-14 9:07am    
sir i want file path in string format

pls help
DamithSL 22-Oct-14 9:53am    
check my updated answer

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