Click here to Skip to main content
15,909,445 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: ListView with 50,000 controls Pin
Moonwalker0315-Mar-11 21:52
Moonwalker0315-Mar-11 21:52 
QuestionForce xaml update from C# code Pin
marca2922-Mar-11 23:52
marca2922-Mar-11 23:52 
AnswerRe: Force xaml update from C# code Pin
SledgeHammer013-Mar-11 4:57
SledgeHammer013-Mar-11 4:57 
QuestionUnable to view the properties of third party grid contorls using Iaccessible interface Pin
Akhil042-Mar-11 1:32
Akhil042-Mar-11 1:32 
QuestionWPF : What event will be triggered after window_loaded Pin
DavJes2-Mar-11 0:02
DavJes2-Mar-11 0:02 
AnswerRe: WPF : What event will be triggered after window_loaded Pin
parama_chakra3-Mar-11 20:34
parama_chakra3-Mar-11 20:34 
AnswerRe: WPF : What event will be triggered after window_loaded Pin
SledgeHammer014-Mar-11 8:39
SledgeHammer014-Mar-11 8:39 
QuestionLoad picture from resource file XAML Pin
Mc_Topaz1-Mar-11 21:40
Mc_Topaz1-Mar-11 21:40 
I would like to display a picture in my WPF application, where the picture is loaded from a resource file. I have no idéa how to pull this off. Please help me.

This is what I have done:

1) Created a new WPF application called: WpfApplication1
2) Created a resource file called: Pictures.resx
3) Added the picture into the resource file
4) The picture is called: CELabel, in the resoruce file explorer window
5) Automatically a folder in in my application is created, called Resources, containing the picture: CELabel.png

Now I would like to code the appropriate XAML code to display the picture. So I tried this:
<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Image Source="/Pictures/CELabel.png"></Image>
    </Grid>
</Window>

And of course the damn compiler results in an error:
Could not find a part of the path 'C:\Pictures\CELabel.png'

Yes, of course the resource file is not recognizable in the XMAL editor and then my picture cannot be loaded.
How do I pull this off? I'm sure this is rediculious easy when knowing how...
AnswerRe: Load picture from resource file XAML Pin
Pete O'Hanlon1-Mar-11 22:19
mvePete O'Hanlon1-Mar-11 22:19 
GeneralRe: Load picture from resource file XAML Pin
Mc_Topaz1-Mar-11 22:36
Mc_Topaz1-Mar-11 22:36 
AnswerRe: Load picture from resource file XAML Pin
Tarun.K.S2-Mar-11 2:51
Tarun.K.S2-Mar-11 2:51 
Questioncheck if windows service is stopped. Pin
arkiboys28-Feb-11 21:16
arkiboys28-Feb-11 21:16 
AnswerRe: check if windows service is stopped. Pin
Vimalsoft(Pty) Ltd28-Feb-11 21:34
professionalVimalsoft(Pty) Ltd28-Feb-11 21:34 
GeneralRe: check if windows service is stopped. Pin
arkiboys28-Feb-11 21:47
arkiboys28-Feb-11 21:47 
AnswerRe: check if windows service is stopped. Pin
RobCroll28-Feb-11 21:36
RobCroll28-Feb-11 21:36 
GeneralRe: check if windows service is stopped. Pin
arkiboys28-Feb-11 21:50
arkiboys28-Feb-11 21:50 
GeneralRe: check if windows service is stopped. Pin
Pete O'Hanlon28-Feb-11 23:10
mvePete O'Hanlon28-Feb-11 23:10 
GeneralRe: check if windows service is stopped. Pin
arkiboys1-Mar-11 0:15
arkiboys1-Mar-11 0:15 
GeneralRe: check if windows service is stopped. Pin
Pete O'Hanlon1-Mar-11 0:18
mvePete O'Hanlon1-Mar-11 0:18 
GeneralRe: check if windows service is stopped. Pin
arkiboys1-Mar-11 1:10
arkiboys1-Mar-11 1:10 
GeneralRe: check if windows service is stopped. Pin
Pete O'Hanlon1-Mar-11 1:19
mvePete O'Hanlon1-Mar-11 1:19 
GeneralRe: check if windows service is stopped. Pin
arkiboys1-Mar-11 1:59
arkiboys1-Mar-11 1:59 
GeneralRe: check if windows service is stopped. Pin
Pete O'Hanlon1-Mar-11 2:51
mvePete O'Hanlon1-Mar-11 2:51 
GeneralRe: check if windows service is stopped. Pin
arkiboys1-Mar-11 3:09
arkiboys1-Mar-11 3:09 
GeneralRe: check if windows service is stopped. Pin
Pete O'Hanlon1-Mar-11 3:28
mvePete O'Hanlon1-Mar-11 3:28 

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.