Click here to Skip to main content
11,496,146 members (525 online)
Click here to Skip to main content

Tagged as

Load external images in WPF via XAML ?

, 19 Apr 2010 CPOL 16.6K 8
Sometimes we need to show an external image directly in WPF.Assume we have a folder that is named images beside of our main's WPF exe file. There is an image in this folder that's named sample.png.Now with the following XAML code, we can show it in WPF directly:<Image...
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
Sometimes we need to show an external image directly in WPF.
Assume we have a folder that is named images beside of our main's WPF exe file. There is an image in this folder that's named sample.png.
Now with the following XAML code, we can show it in WPF directly:

<Image Source="pack://siteoforigin:,,,/images/sample.png" />

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Mohammad Dayyan

Iran (Islamic Republic Of) Iran (Islamic Republic Of)
No Biography provided

Comments and Discussions

 
QuestionDidn't load any external image Pin
liordino10-Sep-12 10:51
memberliordino10-Sep-12 10:51 
AnswerRe: Didn't load any external image Pin
Mohammad Dayyan27-Sep-12 3:27
memberMohammad Dayyan27-Sep-12 3:27 
QuestionNo Comment Pin
idzodzo26-Jun-12 0:43
memberidzodzo26-Jun-12 0:43 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150520.1 | Last Updated 19 Apr 2010
Article Copyright 2010 by Mohammad Dayyan
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid