Reputation: 303
I have an image <Image x:Name="image" Source="fingerprint.png" Height="1000"/>
.
The image is higher than the form, so it doesn't fit in it completely.
When I move the image by image.Margin = new Thickness(0, image.Margin.Top - 50, 0, image.Margin.Bottom + 50);
, the part of the image that wasn't visible before is still not visible, although it's now in the form (see red arrow).
Upvotes: 0
Views: 53
Reputation: 1583
The Margin of the image will only control how close to the edges of the parent control your image is allowed to be.
I'm not sure what you are trying to achieve, but if you want the bottom of your image to be visible you need to either change its Position or scale it to fit inside the parent control.
Check this http://www.wpftutorial.net/LayoutProperties.html link to see some visualizations of layouting in WPF.
http://wpf.2000things.com/2011/04/14/276-change-image-sizing-using-the-stretch-property/ has some explanations about how to scale an image.
Upvotes: 1