Question about the resized image quality on high DPI screen


  • Hi,

    I have an question about the images on high DPI screen.

    Suppose I have a image with pixel-size 500*500, and I want to draw it to a canvas with new screen size 100*100 by using Canvas.drawImage.

    My question is: If it is on a screen with 180% DPI, in order to get the best quality, should I simply use Canvas.drawImage(img, 0,0,500,500, 0,0, 100,100) to draw the image?  Or I should set the width and height of canvas to 180 (while set it's screen width/height to 100px by CSS), then call Canvas.drawImage(img, 0,0,500,500, 0,0, 180,180)?

    From this thread:http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/53c1ec3e-6e18-4a97-883c-40a10fbe50d8,  I know I don't need to care about DPI when using custom drawing on canvas, but is it the same when drawing images?

    Thanks in advance



    woodhead is as woodhead does

    Monday, July 16, 2012 12:01 PM


  • Hi,

    I would like to point out that Metro applications are already DPI aware. Everything on the screen will automatically be scaled according to DPI. It is not needed to worry about that.

    Best Regards,

    Ming Xu.

    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework

    • Marked as answer by Alex ZS Wednesday, July 18, 2012 1:31 AM
    Tuesday, July 17, 2012 11:12 AM