Click here to Skip to main content
15,844,754 members
Home / Discussions / WPF
   

WPF

 
QuestionCan't get UriKind.Relative to work Pin
fjparisIII15-Oct-09 6:41
fjparisIII15-Oct-09 6:41 
AnswerRe: Can't get UriKind.Relative to work Pin
Mark Salsbery15-Oct-09 8:06
Mark Salsbery15-Oct-09 8:06 
GeneralRe: Can't get UriKind.Relative to work Pin
fjparisIII15-Oct-09 9:13
fjparisIII15-Oct-09 9:13 
GeneralRe: Can't get UriKind.Relative to work Pin
Mark Salsbery15-Oct-09 9:17
Mark Salsbery15-Oct-09 9:17 
GeneralRe: Can't get UriKind.Relative to work Pin
fjparisIII15-Oct-09 10:14
fjparisIII15-Oct-09 10:14 
General[Message Deleted] Pin
fjparisIII15-Oct-09 12:42
fjparisIII15-Oct-09 12:42 
QuestionRe: Can't get UriKind.Relative to work Pin
Mark Salsbery16-Oct-09 8:34
Mark Salsbery16-Oct-09 8:34 
AnswerRe: Can't get UriKind.Relative to work Pin
fjparisIII16-Oct-09 9:43
fjparisIII16-Oct-09 9:43 
Thanks for your reply and hanging in there on this extremely puzzling failure of UriKind.Relative. I did as you said, adding an ImageFailed handler to the image. When I set image.Source to the BitmapImage however, The ImageFailed event did not occur. The image simply did not show up in the window containing the image.

What I want to do is set the window Width and Height based on the PixelWidth and PixelHeight of the BitmapImage (taking into consideration the window border width and window option height -- irrelevant details). But the effort to get PixelWidth and PixelHeight causes an exception, in the following code:

double imageWidth = 450;
double imageHeight = 300;
try
{
    imageWidth = screenshot.PixelWidth;
    imageHeight = screenshot.PixelHeight;
}
catch (Exception ex)
{
    string error = ex.Message;
}


As you can see, I set a default width and height to 450x300, just so the window shows up at all, but it shows up empty. string error in the exception handler says this (slightly simplified so just so you get the idea that it is looking at a path in my source code rather than a path in my project assembly):

"Could not find a part of the path 'C:\\...\\bin\\Debug\\Images\\screenshot.png'."

See the following reply for further details on what is happening. Maybe that will provide you with a clue about what is going on here.
http://www.codeproject.com/Messages/3237304/Re-Cant-get-UriKind-Relative-to-work.aspx[^]
GeneralRe: Can't get UriKind.Relative to work Pin
fjparisIII16-Oct-09 9:05
fjparisIII16-Oct-09 9:05 
GeneralRe: Can't get UriKind.Relative to work Pin
Mark Salsbery16-Oct-09 9:53
Mark Salsbery16-Oct-09 9:53 
GeneralRe: Can't get UriKind.Relative to work SOLVED! Pin
fjparisIII16-Oct-09 15:33
fjparisIII16-Oct-09 15:33 
GeneralRe: Can't get UriKind.Relative to work SOLVED! Pin
Mark Salsbery16-Oct-09 15:46
Mark Salsbery16-Oct-09 15:46 
GeneralRe: Can't get UriKind.Relative to work SOLVED! Pin
fjparisIII16-Oct-09 16:38
fjparisIII16-Oct-09 16:38 
QuestionNothing displayed when set a line to DashStyles.Dot Pin
CooperWu15-Oct-09 5:58
CooperWu15-Oct-09 5:58 
AnswerRe: Nothing displayed when set a line to DashStyles.Dot Pin
Mark Salsbery15-Oct-09 9:04
Mark Salsbery15-Oct-09 9:04 
QuestionControl Limitation Pin
Saiyed Alam14-Oct-09 19:39
Saiyed Alam14-Oct-09 19:39 
AnswerRe: Control Limitation Pin
Ian Shlasko15-Oct-09 4:47
Ian Shlasko15-Oct-09 4:47 
QuestionMenuItems not showing properly Pin
Shelby Robertson 14-Oct-09 5:56
Shelby Robertson 14-Oct-09 5:56 
AnswerRe: MenuItems not showing properly Pin
Mark Salsbery14-Oct-09 8:51
Mark Salsbery14-Oct-09 8:51 
GeneralRe: MenuItems not showing properly Pin
Shelby Robertson 14-Oct-09 9:00
Shelby Robertson 14-Oct-09 9:00 
GeneralRe: MenuItems not showing properly Pin
Shelby Robertson 14-Oct-09 14:12
Shelby Robertson 14-Oct-09 14:12 
GeneralRe: MenuItems not showing properly Pin
Mark Salsbery15-Oct-09 8:14
Mark Salsbery15-Oct-09 8:14 
GeneralRe: MenuItems not showing properly Pin
Shelby Robertson 15-Oct-09 8:16
Shelby Robertson 15-Oct-09 8:16 
QuestionTreeView Parent Control Pin
Adriaan Davel14-Oct-09 2:55
Adriaan Davel14-Oct-09 2:55 
QuestionProgress bar on loading a page Pin
ravi.vellanky13-Oct-09 21:13
ravi.vellanky13-Oct-09 21:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.