Question

I'm working on a project for school, I am extremely knew to ironpython. I am trying to work with a couple of images. I want to be able to drag them using the mouse, but I can't even get the image to show up on the form when I run the program. It shows just fine inside the designer, and disappears once I run the program.

here is my code so far...

<Window 
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
       Title="WpfApplication3" Height="1000" Width="1000" Background="Green"> 
       <Grid>

        <Button Width="75" Height="50" Click="Button_Click">Push Me</Button>
        <Image  HorizontalAlignment="Left" Height="100" Margin="289,460,0,0" VerticalAlignment="Top" Width="100">
            <Image.Source>
                <BitmapImage UriSource="/Images/atlantafalcons.jpg" />
            </Image.Source>
        </Image>
    </Grid>
</Window> 

I don't understand what I am doing wrong...

Was it helpful?

Solution

Just remove first backslash:

<Grid>
    <Button Width="75" Height="50" Click="Button_Click">Push Me</Button>
    <Image  HorizontalAlignment="Left" Height="100" Margin="289,460,0,0" VerticalAlignment="Top" Width="100">
        <Image.Source>               
            <BitmapImage UriSource="Images/atlantafalcons.jpg" />
        </Image.Source>
    </Image>
</Grid>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top