This project has moved and is read-only. For the latest updates, please go here.

Relative path for image

May 25, 2011 at 5:11 PM
Edited May 25, 2011 at 5:15 PM

Hello,

I dont want to specify the exact source like C:\myfolder\newfolder\Icon\variables.bmp" instead can I specify relative path ..\Icon\Variable.bmp

May 25, 2011 at 5:12 PM

Could you provide more information?  What control are you using and what are your trying to do with it?

May 25, 2011 at 5:17 PM

I have created a image file in saved as C:\myfolder\newfolder\Icon\variables.bmp" now I'm using a Image button and I have to specify the source which just allows absolute path and I need to have relative path. Please help

May 25, 2011 at 6:46 PM

Include the image in your project.

May 25, 2011 at 8:59 PM

I have created and added a folder to my project and then added image file to my project trying to use URI relative path. it says cannot find the file when i say source =" ./Icon/variable.bmp"

May 25, 2011 at 9:04 PM
Edited May 25, 2011 at 9:04 PM

get rid of the ".". Also, make sure you set the content type correctly.  If you still have problems look at using a pack URI: http://msdn.microsoft.com/en-us/library/aa970069.aspx

Next time I woud recommend asking this type of question in the WPF Forums: http://social.msdn.microsoft.com/forums/en/wpf/threads/

I don't minding helping you but it is important to try to keep non Extended WPF Toolkit questions out of the discussion board.

Thanks.