Bug 42109 - Image renderer works differently when scaling up as compared to scaling down
Summary: Image renderer works differently when scaling up as compared to scaling down
Status: RESOLVED DUPLICATE of bug 27729
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-23 12:40 UTC by Willem Mali
Modified: 2016-06-24 17:26 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Screenshot illustrating what's going wrong. (395.30 KB, image/png)
2016-06-23 12:40 UTC, Willem Mali
Details
Screenshot (304.21 KB, image/png)
2016-06-23 12:49 UTC, Willem Mali
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 27729

Description Willem Mali 2016-06-23 12:40:29 UTC
Created attachment 16455 [details]
Screenshot illustrating what's going wrong.

Hi,

I'm trying to implement a banner, to be shown at the top of a login page. Now, the issue I'm having is this:

When I set Image.VerticalOptions="StartAndExpand" and Image.HorizontalOptions="Fill", I expect my image to fill the width of its parent, and try to expand itself and I expect the image to maintain its aspect ratio. When the size of my banner image is larger than the size it's rendered at, it all works fine.
However, when the image width in pixels is smaller than the display width in pixels, things break down. The image still does occupy the right area, but instead of rendering the image at the size of this area, the image is rendered in the left corner, at scale 1.0X.

I attached a screenshot to this report, it should demonstrate the issue clearly.

I stumbled upon this in an Android project, so I marked the component field "Android".

XAML for the image:

<StackLayout HorizontalOptions="Fill" VerticalOptions="Fill">
    <Image
      Source="Banner.png"
      HorizontalOptions="Fill"
      VerticalOptions="StartAndExpand"
      />
</StackLayout>
Comment 1 Willem Mali 2016-06-23 12:47:39 UTC
I think this is a slightly clearer example:

<StackLayout
    HorizontalOptions="Fill"
    VerticalOptions="Fill"
    BackgroundColor="Black"
    >
    <Image
      Source="Banner.png"
      Aspect="AspectFit"
      HorizontalOptions="Fill"
      VerticalOptions="StartAndExpand"
      BackgroundColor="Fuchsia"
      />
</StackLayout>
Comment 2 Willem Mali 2016-06-23 12:49:30 UTC
Created attachment 16457 [details]
Screenshot
Comment 3 Samantha Houts [MSFT] 2016-06-24 17:26:34 UTC
This has the same root cause as 27729.

*** This bug has been marked as a duplicate of bug 27729 ***