Let's follow these steps to add images in the MainWindow.xaml page:
- Open the MainWindow.xaml page, and replace the existing Grid with a StackPanel. Set its Orientation property to Horizontal so that the items added to this panel stack themselves horizontally.
- Add four images to the StackPanel, and set their Source property to demoImage.jpg, which is available within the project directory.
- Set the width and the height of each image to 100.
- For the first image, set its Stretch property to None.
- For the second image, set its Stretch property to Fill.
- For the third and fourth images, set their Stretch property to Uniform and UniformToFill, respectively.
- Here's the complete XAML code, to which you can refer:
<StackPanel Orientation="Horizontal"> <Image Source="demoImage.jpg" Stretch="None" Width="100" Height="100" Margin="10 10 5 10" /> <...