Using XAML and ironpython in WPF, image shows in designer window but not when I run the program

user3204147

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...

kmatyaszek

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>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

WPF window layout looks different from VS designer when running

From Dev

how to display image from gridview using fragment after i run the program?

From Dev

WPF .xaml designer exception

From Dev

WPF Using XAML Image Source

From Dev

Domino designer run selected frameset when program start

From Dev

WPF window not updating with binding in XAML

From Dev

Visual Studio 2015 XAML Designer crashes with WPF

From Dev

Visual Studio Designer shows empty Window when using custom ContentPropertyAttribute

From Dev

When I try to upload and save an image file using Struts in eclipse it shows the file name as null

From Dev

How can i set svg or xaml as a source of image WPF?

From Dev

matplot program gives unresponsive window when run

From Dev

Run another python file that shows camera preview using Tkinter window

From Dev

Visual Studio XAML Designer not showing correctly window's background image

From Dev

Domino designer run selected frameset when program start

From Dev

wpf image from xaml not shown on run

From Dev

WPF window/usercontrol inheritance XAML

From Dev

java.lang.NumberFormatException Error shows when trying to run program

From Dev

How do I deal with C# decimals when using IronPython?

From Dev

Visual Studio 2015 XAML Designer crashes with WPF

From Dev

A c program works well in Ubuntu but when I compile and run it in windows using MinGW, the program runs but in result it shows some garbage value

From Dev

How do I have dynamic elements in a XAML WPF window

From Dev

Why does my program not output anything in the command window when I run it?

From Dev

Why does my window form look different when I run the program in Visual Studio?

From Dev

I cannot make code run that shows error is like Using $this when not in object context?

From Dev

Console window closes immediately when I run the program

From Dev

WPF - XAML Page Center to Window

From Dev

ImageView shown in designer's preview but not showing when I run app

From Dev

Why do resource files "disappear" from the WPF Designer when referenced from a Window?

From Dev

I am working on a discord bot using Python. Everytime I run the program, error shows up "discord module not found." I installed discord.py using pip

Related Related

  1. 1

    WPF window layout looks different from VS designer when running

  2. 2

    how to display image from gridview using fragment after i run the program?

  3. 3

    WPF .xaml designer exception

  4. 4

    WPF Using XAML Image Source

  5. 5

    Domino designer run selected frameset when program start

  6. 6

    WPF window not updating with binding in XAML

  7. 7

    Visual Studio 2015 XAML Designer crashes with WPF

  8. 8

    Visual Studio Designer shows empty Window when using custom ContentPropertyAttribute

  9. 9

    When I try to upload and save an image file using Struts in eclipse it shows the file name as null

  10. 10

    How can i set svg or xaml as a source of image WPF?

  11. 11

    matplot program gives unresponsive window when run

  12. 12

    Run another python file that shows camera preview using Tkinter window

  13. 13

    Visual Studio XAML Designer not showing correctly window's background image

  14. 14

    Domino designer run selected frameset when program start

  15. 15

    wpf image from xaml not shown on run

  16. 16

    WPF window/usercontrol inheritance XAML

  17. 17

    java.lang.NumberFormatException Error shows when trying to run program

  18. 18

    How do I deal with C# decimals when using IronPython?

  19. 19

    Visual Studio 2015 XAML Designer crashes with WPF

  20. 20

    A c program works well in Ubuntu but when I compile and run it in windows using MinGW, the program runs but in result it shows some garbage value

  21. 21

    How do I have dynamic elements in a XAML WPF window

  22. 22

    Why does my program not output anything in the command window when I run it?

  23. 23

    Why does my window form look different when I run the program in Visual Studio?

  24. 24

    I cannot make code run that shows error is like Using $this when not in object context?

  25. 25

    Console window closes immediately when I run the program

  26. 26

    WPF - XAML Page Center to Window

  27. 27

    ImageView shown in designer's preview but not showing when I run app

  28. 28

    Why do resource files "disappear" from the WPF Designer when referenced from a Window?

  29. 29

    I am working on a discord bot using Python. Everytime I run the program, error shows up "discord module not found." I installed discord.py using pip

HotTag

Archive