AspectFill image cropping different on iOS and UWP (Xamarin Forms)
See original GitHub issueThank you for this wonderful library! It has solved so many issues I’ve had with the default Xamarin Forms Image view. I found a small bug though:
When displaying an image with AspectFill the displayed portion of the image is cropped from the center of the image on iOS but from the top left corner on UWP.
My image is wider than it needs to be and is included in the xaml like so:
<ffimage:CachedImage Source="{Binding BackgroundImage}" Aspect="AspectFill" />
This is the source image:
It looks like this on iOS (which is what I want): However it looks like this on UWP:
On a related note, did you consider including a property which could be used to define where to crop the image, eg. center, topleft, left,…?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:23 (11 by maintainers)
Top Results From Across the Web
Can I make Xamarin Image AspectFit crop rather than pad?
Is there a way to get Xamarin Forms to crop rather than pad? VS 2019 Community on Windows 10 Pro 64. Target platforms...
Read more >Images in Xamarin.Forms
AspectFill - Clips the image so that it fills the display area while preserving the aspect (i.e. no distortion). AspectFit - Letterboxes the ......
Read more >How to crop an image in Xamarin Forms
Google with crop image xamairn.forms , you'll find what you want . Download the sample projects and try on your side .
Read more >Contributing to Xamarin Forms
It wasn't a big change, just bringing WinRT/UWP into alignment with iOS and Android in regards to center cropping images when in AspectFill....
Read more >XFHACKS-009 Frame with Border Image!
Ever wanted to have a Xamarin.Forms.Frame with a Border Image? Or have a Border Image around any of your Xamarin.Forms Elements?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
just fyi, here is the project I’ve used to test the different scenarios on UWP. Uncomment all lines from UWP/ImageExtRenderer to see the differences.
FFImageCropTest.zip
@dominik-weber Hi, I’ve missed that, sorry. Sure, we can change it to have a unified behavior.