Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Please help:How can i move around an Image programmatically and have it clip/cut off on its parent ?

$
0
0

Hello,

i need to achieve the following scenario:

Display an image an move it up and down. The place where the image is visible shut be definable. If it goes over the visible area it should clip/cut off
The images are somtime larger than the visible area or smaller. I don’t that the user can move around the image, only programmatically.

I have tried several ideas:

1) Put the Image into a Grid and use Image.TranslationY -> moves the Image around , but is not clipping at the Row / Colum Border.
2) Put the Image into a Frame Control and then into the Grid -> if I then use Image.TranslationY it is getting ignored. If I use Frame.TranslationY
-> this moves the Frame without Clipping outside the Grid (same as on 1)
(using IsClippedToBounds = true;)

On WinRT (XAML) I was using a scroll viewer the get it working. On WinRT there I have margins to move around the Image programmatically, on XF I only have padding.

What is the best way to achieve this ?

For better understanding I am attaching a picture that’s show the needed result.

Thanks
DanB
#

image


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>