-->

Monday, July 27, 2015

Add image in wpf window background

Add image in wpf window background

If you want to add image in window background of WPF application then you should use Window.Background tag in xaml. Before set the image in background you must to add the image in the solution explorer. If you add image in the subfolder then specified the path of the folder like below example.

<Window x:Class="SplashSCreen.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SplashSCreen"
        mc:Ignorable="d"
        Title="MainWindow" Height="500" Width="525">



    <Window.Background>
        <ImageBrush ImageSource="image/nokia.jpg" />
    </Window.Background>




    <Grid>
     
    </Grid>
</Window>

Now, code generate the following output:

Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved