question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AspectFill image cropping different on iOS and UWP (Xamarin Forms)

See original GitHub issue

Thank 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: image

It looks like this on iOS (which is what I want): image However it looks like this on UWP: image

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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
dominik-webercommented, Sep 23, 2016

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

1reaction
daniel-luberdacommented, Sep 23, 2016

@dominik-weber Hi, I’ve missed that, sorry. Sure, we can change it to have a unified behavior.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found