This is a migrated thread and some comments may be shown as answers.

Picture Box with embedded resources

3 Answers 299 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 02 Mar 2011, 04:23 PM
I have images in my project whose build action are set to Resource.  On a WPF form i can use relative paths to access the images as they are embedded in the resources.dll for the project.  When i try to bind a picture box to the relative path of the image, it gives file not found as it builds the path as though it is a physical path.  How can you bind a picture box to an image whose build action is resource?

3 Answers, 1 is accepted

Sort by
0
Chris Gillies
Top achievements
Rank 1
answered on 08 Mar 2011, 02:53 PM
You can create User Functions that would return the correct path from the resources.

Cheers!
0
John
Top achievements
Rank 1
answered on 08 Mar 2011, 05:36 PM
This answer doesn't really answer the question.  Sure, i could use a User Function, but what should the code within that function do?  Also, i can get the "path".  The problem is, the path that is built thinks it is a physical file on the system.  In reality the file is in the Resources.dll for the project.  WPF can use the relative path and it knows that the file is in the Resources.dll file and the relative path within that file where to find the path.  I can't seem to get this to work with the Telerik reporting picture box.
0
Chris Rathermel
Top achievements
Rank 1
answered on 02 Nov 2011, 10:42 PM
John,

Did you get this to work? 
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Chris Gillies
Top achievements
Rank 1
John
Top achievements
Rank 1
Chris Rathermel
Top achievements
Rank 1
Share this question
or