locked
Get resolutionScale in Background task

    Question

  • Hi all,

    I want to access to the screen's resolution scale (100%, 140% or 180%) in my background task.

    Unfortunately, referring to

    Windows.Graphics.Display.DisplayInformation.getForCurrentView().resolutionScale

    inside a background task throws an Exception because there is no view attached to the Background task: it's a web worker. That makes sense, but my question is: How can I get the resolutionScale in this case? Is there another way to get it without referring to the view?

    Thanks in advance.

    Wednesday, March 12, 2014 10:53 AM

All replies

  • save it in the local settnigs when the app is running and use that value in your background task?

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Wednesday, March 12, 2014 12:54 PM
  • That's my backup plan but I wanted to know if there wasn't any other access to this information: if the user changes his resolution on a 1080p 10 inches screen, it will change the resolution scale, no? If so, the task will have a wrong scale until the user launches the app...
    Wednesday, March 12, 2014 2:23 PM
  • There isn't a meaningful answer.

    The scale may be different on different monitors. Which monitor is the background task running on?

    What do you plan to do with this information? There may be a different solution?

    Wednesday, March 12, 2014 2:49 PM
    Owner
  • I plan to send notifications (toasts and tiles update) with pictures in a size that doesn't make them blurred, for example, I want to send a 310*150 picture to a wide tile on a 100% scale screen but a 434*210 picture on a 140% scale screen.
    Wednesday, March 12, 2014 3:01 PM