Click here to Skip to main content
15,886,362 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Can't get UriKind.Relative to work Pin
fjparisIII15-Oct-09 8:13
fjparisIII15-Oct-09 8:13 
GeneralRe: Can't get UriKind.Relative to work Pin
Mark Salsbery15-Oct-09 8:17
Mark Salsbery15-Oct-09 8:17 
GeneralRe: Can't get UriKind.Relative to work Pin
fjparisIII15-Oct-09 9:14
fjparisIII15-Oct-09 9:14 
General[Message Deleted] Pin
fjparisIII15-Oct-09 11:42
fjparisIII15-Oct-09 11:42 
QuestionRe: Can't get UriKind.Relative to work Pin
Mark Salsbery16-Oct-09 7:34
Mark Salsbery16-Oct-09 7:34 
AnswerRe: Can't get UriKind.Relative to work Pin
fjparisIII16-Oct-09 8:43
fjparisIII16-Oct-09 8:43 
GeneralRe: Can't get UriKind.Relative to work Pin
fjparisIII16-Oct-09 8:05
fjparisIII16-Oct-09 8:05 
GeneralRe: Can't get UriKind.Relative to work Pin
Mark Salsbery16-Oct-09 8:53
Mark Salsbery16-Oct-09 8:53 
I'm not sure what's happening on your end, but you
shouldn't be getting any paths like "C:\...\bin\Debug\Images\Airplane.png",
since that is NOT a pack uri for extracting a resource image.

As far as getting PixelWidth/PixelHeight, that could be tricky.
For example, with the following code:
myimage.ImageFailed += new EventHandler<ExceptionRoutedEventArgs>(myimage_ImageFailed);
Uri uri = new Uri("/Images/Airplane.png", UriKind.RelativeOrAbsolute);
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = uri;
bi.EndInit();
myimage.Source = bi;

with a breakpoint on "myimage.Source = bi;", bi.PixelWidth/bi.PixelHeight
are 0, and also having the breakpoint there causes the image to not appear.
Put a breakpoint after "myimage.Source = bi;" (removing the
previous breakpoint!) and bi.PixelWidth/bi.PixelHeight are valid (but
is that just lucky timing?).

It appears the decoding is asynchronous, and I see no event for
decoding completion...

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Can't get UriKind.Relative to work SOLVED! Pin
fjparisIII16-Oct-09 14:33
fjparisIII16-Oct-09 14:33 
GeneralRe: Can't get UriKind.Relative to work SOLVED! Pin
Mark Salsbery16-Oct-09 14:46
Mark Salsbery16-Oct-09 14:46 
GeneralRe: Can't get UriKind.Relative to work SOLVED! Pin
fjparisIII16-Oct-09 15:38
fjparisIII16-Oct-09 15:38 
QuestionNothing displayed when set a line to DashStyles.Dot Pin
CooperWu15-Oct-09 4:58
CooperWu15-Oct-09 4:58 
AnswerRe: Nothing displayed when set a line to DashStyles.Dot Pin
Mark Salsbery15-Oct-09 8:04
Mark Salsbery15-Oct-09 8:04 
QuestionControl Limitation Pin
Saiyed Alam14-Oct-09 18:39
Saiyed Alam14-Oct-09 18:39 
AnswerRe: Control Limitation Pin
Ian Shlasko15-Oct-09 3:47
Ian Shlasko15-Oct-09 3:47 
QuestionMenuItems not showing properly Pin
Shelby Robertson 14-Oct-09 4:56
Shelby Robertson 14-Oct-09 4:56 
AnswerRe: MenuItems not showing properly Pin
Mark Salsbery14-Oct-09 7:51
Mark Salsbery14-Oct-09 7:51 
GeneralRe: MenuItems not showing properly Pin
Shelby Robertson 14-Oct-09 8:00
Shelby Robertson 14-Oct-09 8:00 
GeneralRe: MenuItems not showing properly Pin
Shelby Robertson 14-Oct-09 13:12
Shelby Robertson 14-Oct-09 13:12 
GeneralRe: MenuItems not showing properly Pin
Mark Salsbery15-Oct-09 7:14
Mark Salsbery15-Oct-09 7:14 
GeneralRe: MenuItems not showing properly Pin
Shelby Robertson 15-Oct-09 7:16
Shelby Robertson 15-Oct-09 7:16 
QuestionTreeView Parent Control Pin
Adriaan Davel14-Oct-09 1:55
Adriaan Davel14-Oct-09 1:55 
QuestionProgress bar on loading a page Pin
ravi.vellanky13-Oct-09 20:13
ravi.vellanky13-Oct-09 20:13 
AnswerRe: Progress bar on loading a page Pin
Mark Salsbery14-Oct-09 7:39
Mark Salsbery14-Oct-09 7:39 
GeneralRe: Progress bar on loading a page Pin
ravi.vellanky14-Oct-09 18:21
ravi.vellanky14-Oct-09 18:21 

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.