locked
Scaling in Windows Phone 8.1 (Windows Runtime)

    Question

  • This page:

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

    states that there are three possible scaling factors for Windows Phone 8.1:

    • 1.0
    • 1.4
    • 2.4

    However, if I run all emulators, I get (from DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel):

    • 1.2 (WVGA)
    • 2.0 (WXGA)
    • 1.8 (720p)
    • 2.4 (1080p 5.5'')
    • 2.2 (1080p 6.0'')

    So, is the page wrong or are the emulators wrong?

    Thursday, October 16, 2014 8:51 PM

All replies

  • I don't think either is wrong, but that you're referring to two different things.   The documentation states that Windows scales to one of those three scaling plateaus, but that does not mean that those are the only scaling plateaus possible.

    Are you running into a problem with this?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, October 17, 2014 12:52 PM
    Moderator
  • Thank you for your answer, but unfortunately, I don't understand it.

    You say that I am referring to two different things. What two different things?

    The docs say that there are exactly three possible values. However, the emulators give me more and different values.

    Yes, I could run into problems:

    Imagine, I want to have a picture in my layout which should be 100 x 100 logical units wide and high.

    If I only have 100%, 140% and 240% image assets, what image should be used for a real world device which has a scaling factor of 1.2?

    Sure, I could use the 100% image and scale up, or I could use the 140% image and scale down. But both solutions would lead to sub-optimal results.

    I would like to know: Which scaling factors are really possible? (If the emulators act like real phones, then the docs are completely wrong)

    Friday, October 17, 2014 3:06 PM
  • The documentation does not say that there are exactly three possible values and no others.  It says that Windows uses one of those three values when it performs scaling functions.

    Go by what the documentation says and you'll be fine.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, October 17, 2014 4:29 PM
    Moderator
  • > "It says that Windows uses one of those three values when it performs scaling functions."

    What do you mean by "scaling functions"? I hope you mean the mapping between the logical coordinate system and the physical coordinate system.

    And then, your sentence "Windows uses one of those three" is not true. On the emulators for Windows Phone 8.1 (and presumably on all real devices), Windows uses values other than those three.

    For example, take a rectangle with Width = 100 and Height = 100. On a device with RawPixelsPerViewPixel = 1.2 this leads to a rectangle with 120x120 physical device pixels.

    (and not to 140x140 nor to 240x240 physical device pixels)

    You don't see a chance that the documentation is just wrong? (It would not be the first time.)

    Do you have contact to the internal team that works on this topic? 

    Friday, October 17, 2014 5:08 PM
  • If you're getting a different experience than what the documentation says, and you can reproduce the problem across actual devices, then you can let us know that there's a problem and we'll file it.

    So, what's the problem that you're running into, how does it conflict with the documentation, and does it reproduce on a physical device or just in the emulator?  Please and provide an app that shows this, then state clearly the expected outcome and the actual outcome, so I can file a bug.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, October 17, 2014 5:42 PM
    Moderator
  • I think the document is talking about "Tile Image".

    If the image is used in your apps, you can build all scaling (as your testing result) image to make the app being more perfect.


    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    Wednesday, October 22, 2014 3:53 PM
  • @Bill Chung:

    I don't think the document is about Tile Image because it says: "Windows automatically scales your app based on the following scaling plateaus: "

    @Matt Small:

    I have ordered a Windows Phone now to completely convince you about the mistake in the document. (Would have ordered one anyway, but now it is a little bit sooner.)

    As soon as I have found that the real device behaves like the emulator, I will post again.

    Thursday, October 23, 2014 8:45 AM
  • Hi eikuh:
    you can see the device panel on visual studio. as below:

     I made a simple project to test it. download here


    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    Thursday, October 23, 2014 7:10 PM
  • @Bill Chung:

    Thank you for your answer! Unfortunately, the download link gives me a 404 response. But anyway, your screenshot shows what I was talking about: The documentation is wrong. There are various scaling factors.

    @Matt Small:

    Now, I own a Nokia Lumia 630 (beautiful phone by the way).

    I ran my test and it gave me:

    RawPixelsPerViewPixel: 1.2
    Bounds: 400x666.666625976563

    This is exactly what the emulator resulted in and it makes sense:

    400 * 1.2 = 480

    666.[6] * 1.2 = 800

    480x800 is the physical resolution of the screen (actually it is 480x854 because of 54 pixel lines soft navigation buttons)

    So, Matt are you finally convinced that the documentation is wrong?

    There are not only factors 1.0, 1.4 and 2.4 but also 1.2, 1.8, 2.0, 2.2, ...

    Can you get in contact with the documentation team? I already wrote a note ("Was this page helpful?") but it did not change anything.


    • Edited by eikuh Friday, October 24, 2014 8:54 PM
    Friday, October 24, 2014 8:53 PM
  • Hi eikuh:

    Scale factor system is designed for adapting any screen size and resolution.

    So I think there will be more different scale factor  in the future

    And sorry about the downloading, they maintained server therse days, but it work now.


    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。



    Saturday, October 25, 2014 7:15 PM
  • I already wrote a note ("Was this page helpful?") but it did not change anything.

    This is the appropriate way to request a documentation update. It will take some time for the request to be reviewed and the document to be rewritten and published.

    Sunday, October 26, 2014 12:22 AM
    Owner
  • @ Rob Caplan:

    OK, but I am developing now and cannot wait six months or so. So, can you give an ultimate answer: Is just the documentation wrong? And what is correct?

    What kind of scaling factors are possible? Is it true that they are always multiples of 0.2?

    What is the minimum logical screen resolution? 384x640 or 360x600?

    I know from the past that you are somebody who has deep knowledge. So, while the documentation takes time to be correct, can you please give the answers? Thanks!

    @ Herro wong:

    Please don't mark questions of other people as answered.

    Wednesday, October 29, 2014 8:25 AM
  • The docs are neither wrong nor correct.

    Just out dated. Since the time we had only 3 possible resolutions. In latter windows phone 8 updates, support for new resolutions was added, but the docs (and dev tools) didn't update, probably because it doesn't matter all that much. The system scales (or not) it so it keeps aspect ratio when it doesn't the right file for resolution scale. It basically means that you will have more screen space on bigger resolution phones.

    In the particular case of 2x scale, there isn't a need for a new resource file, since it would keep the aspect ratio.


    • Edited by mcosmin Wednesday, October 29, 2014 1:08 PM
    Wednesday, October 29, 2014 1:04 PM
  • > "The docs are neither wrong nor correct. Just out dated"

    They are incorrect because they are outdated.

    And yes, it matters which scaling factors there are. For example for pixel images. Imagine you have an image button with 100x100 logical units. And you think there are only 100%, 140% and 240% factors. So, you make assets with 100x100, 140x140 and 240x240 pixels.

    What will happen on a device with scaling factor of 1.2?

    Either the 100x100 pixel image is up-scaled (-> ugly) or the 140x140 or 240x240 pixel image is down-scaled (-> ugly).

    I really cannot understand why nobody seems to care about the error in the docs. I thought Microsoft would be grateful for every single developer developing for Windows Phone. And I thought Microsoft would be grateful for every bug reporting. But it seems nobody cares. Have you all given up regarding Windows Phone??? 

    Thursday, October 30, 2014 8:47 AM
  • Yes, we care, but there are priorities of bugs.  We heard you say this was a problem, so I asked specifically for the issues that you are facing:

    "So, what's the problem that you're running into, how does it conflict with the documentation, and does it reproduce on a physical device or just in the emulator?  Please and provide an app that shows this, then state clearly the expected outcome and the actual outcome, so I can file a bug."

    You've given us the information that there's a bug, and we'll get around to it.  At worst, this is a documentation bug that you've uncovered.  What more do you need on this issue? 


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, October 30, 2014 2:12 PM
    Moderator
  • @ Matt Small:

    (1) What is the problem I am running into:

    It is not sufficient to have image assets for 100%, 140% and 240%. The reason for that is that there are a lot of scaling factors different than these three. The result is an up- or down-scaled image which does not look perfect.

    (2) How does it conflict with the documentation:

    The documentation says that there are only three scaling factors: 100%, 140%, 240%. The truth is there are many more.

    (3) Can I reproduce it on a physical device:

    Yes, I can. (Nokia Lumia 630)

    (4) Please provide an app that shows this:

    http://www.file-upload.net/download-9773127/AppScalingFactors.zip.html

    This app contains two icons: "icon" and "icon2".

    * "icon" comes in three zoom levels: 100%, 140%, 240%

    * "icon2" comes in four zoom levels: 100%, 120%, 140%, 240%

    Now start this app on a device (or emulator) with 1.2 scaling factor:

    For "icon", WIndows chose the 140% asset and down-scaled it (-> blurry)

    For "icon2", Windows chose the 120% asset (because it was there and it fits perfectly to the 1.2 scaling factor) (-> quality remained the same because no scaling was necessary)

    So, if quality matters for your app, 100%, 140% and 240% assets are not enough. The documentation is wrong.

    My questions are still open:

    * Which scaling factors are possible?

    * What is the minimum screen size (in logical units) then? Is it 384x640 or 360x600?

    Friday, October 31, 2014 8:56 AM
  • Thank you. I'll file a bug.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, October 31, 2014 1:06 PM
    Moderator
  • Thank you for filing a bug! But could somebody from Microsoft answer my questions?

    My questions are still open:

    * Which scaling factors are possible?

    * What is the minimum screen size (in logical units) then? Is it 384x640 or 360x600?

    Thursday, November 6, 2014 8:12 AM
  • Is anybody from Microsoft able to answer these questions? Would be cool!
    Tuesday, November 18, 2014 11:48 AM