Search

Monday, July 27, 2015
0 comments

Add image in wpf window background

8:29 AMMonday, July 27, 2015
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:

Protected by Copyscape Online Copyright Protection Software

0 comments :

Post a Comment

 
Toggle Footer
Top