TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
bodnar edmond
NA
8
0
setting the imagesource
Aug 24 2009 4:07 AM
hi, i am trying to set an image source without giving the full path. It works only with this code:
Uri uri = new Uri("C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/player/poze/open1.jpg");
ImageSource imgSource = new System.Windows.Media.Imaging.BitmapImage(uri);
img_open.SetValue(Image.SourceProperty, imgSource);
But, if i try to run the application on other computers, it doesn't load the image, and it's obvious.
i tried to do somethig like this:
System.Environment.CurrentDirectory = "C:/Documents and Settings/user/My Documents/Visual Studio 2008/Projects/player/poze/";
and then run the code:
Uri uri = new Uri("open2.jpg",UriKind.Relative);
ImageSource imgSource = new System.Windows.Media.Imaging.BitmapImage(uri);
img_open.SetValue(Image.SourceProperty, imgSource);
but it doesn't work.
any suggestions?
Reply
Answers (
2
)
Strange Compile error , my Project Assemby cannot be found Pin
How to pass data from View to View Model