locked
Automatic scaling does not run correctly height or width is to display an image of the 2046 px or more at Windows Store App?

    Question

  • If the width or height of the image to be displayed in 140% or 180% is more than 2046 px, the automatic scaling would not be done properly even though the width and height are explicitly specified and the image would be unnecessarily enlarged and it can't be accommodated within the display area of the Image control.

    Why can't be accommodated within the display area of the Image control  even though the width and height are explicitly specified?

    What am I wrong?

    XAML Code:

    <Image Width="1455" Height="768" Source="Assets/image.jpg"/>

    Expected result:

    Expected result Image sample

    Actual result:

    ※The below figure is 140% scaling example.

    It can't be accommodated within the display area of the Image control.

    Actual result Image sample

    Thanks for reading.



    Sunday, March 09, 2014 3:23 AM

All replies

  • Hi,

    I cannot reproduce the problem. Would you mind share your project in the SkyDrive so that we can test it.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, March 10, 2014 5:38 AM
  • Hello Anne,

    Thank you for reply.

    I uploaded a sample project below.

    Scaling Image Sample Project on OneDrive

    Please confirm whether the problem occurs.

    Monday, March 10, 2014 12:41 PM
  • Hi,

    Do you mean when you scale your computer pixel density to 140%. The image control cannot display 140% image. But in my computer, everything is ok. When I scale computer pixel density to 140%or 180%, the image control can display the scaled image.

    And why you use so large image. You can refer to the link below to know what you need to follow the dos and don'ts  in this topic to ensure your app looks great when scaled:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx 

    And there are some points in the link :

    Important  The images that you provide must not exceed 1024x1024 pixels and must not be more than 200 KB.

    Avoid specifying sizes that aren't multiples of 5px Units that aren't multiples of 5px can experience pixel shifting when scaled to 140% and 180%.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, March 11, 2014 6:21 AM
  • Hello Annne,

    My computer (screen size 1920 x 1080 px), the image can't be accommodated within the display area of the Image control...

    The below figure is simulator results.

    Simulater results

    And I uploaded a sample project for a solution of the problem below.

    Manual Scaling Sample Project on OneDrive

    Expected result(above sample result):

    Manual scaling sample

    I hope to use large image because zooming and scrolling image inside ScrollViewer Control.

    > Important  The images that you provide must not exceed 1024x1024 pixels and must not be more than 200 KB.

    This is required for Image Control? I don't know why the images provides must not exceed 1024x1024 pixels.I specified sizes that aren't multiple of 5px because the problem occured when the image of height or width that are 2046 px or more.

    1462 px * 1.4 = 2046.8 px > 2046 px 

    Thanks.

    Tuesday, March 11, 2014 11:43 AM
  • Hi,

    Is there some artificial limitation on how big an image can be? When using the Win8 simulator or an actual device with a 180% scale resolution screen, images are incorrectly scaled if either the width or the height of the original image > 2045px.

    I can reproduce it either using a normal image in a grid or as the grid background ImageBrush. Here is a test project that you can use to reproduce it: https://onedrive.live.com/redir?resid=B8FFD77F3FC3B955!901&authkey=!AOdSCrNxGFOC9H4&ithint=file%2c.zip

    So run the app in the Win8 Simulator with 2560x1440 (16:9, 180%) resolution and you will see the image get distorted. If you open MainPage.xaml and change the ImageBrush from "broken.png" to "ok.png", the image will no longer be distorted. The difference between the two is that ok.scale-180.png is 2045x2045 and broken.scale-180.png is 2046x2046 pixels.


    Monday, March 17, 2014 3:59 PM
  • > Important  The images that you provide must not exceed 1024x1024 pixels and must not be more than 200 KB.

    I think what this is talking about is avoiding adding big images as "embedded resources", because it increases the load time of the app binary. However, it shouldn't matter for images added as "content". In any case, this is about a problem when trying to render an image larger than 2045 pixels, not 1024. They sound like two separate issues. So I don't think this answers my question.

    Also, 1024x1024 is not a very big image. I seriously doubt that anyone at Microsoft made a conscious system design decision to limit image loading at that number for their new operating system. That rules out the possibility to reliably implement any kind of app that displays photographs for example. This too makes me think that the documentation is talking about a rule of thumb for image sizes added as embedded resources, not a technical limitation in the platform itself.


    Wednesday, March 19, 2014 2:56 PM