Follow these simple steps to move an image from a certain coordinate location specified by the X and Y properties:
- Before working on this, we need to add an image file to the project. From Solution Explorer, right-click on the project node and create a new folder. Name it Images.
- Now right-click on the Images folder and add an existing image from your system. Name it image1.png.
- Open the MainWindow.xaml file and add two images inside the Grid panel. Set the first one with a transparency of 30%. For the second image, add a TranslateTransform to it at a (300,80) location specified by the X and Y properties, as shared in the following screenshot:
<Grid VerticalAlignment="Top" HorizontalAlignment="Left"> <Image Height="300" Width="260" Margin="4" Opacity="0.3" Source="Images/image1.png"/> <Image Height="300" Width="260" ...