Contact Windows Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 4 November 2012

Windows 8 - Images and DPI

Posted on 14:13 by Unknown
Windows 8 is DPI aware then the applications auto-scale images according to DPI and screen resolution:
  • 100% when the scale is not applied.
  • 140% when the screen resolution is 1920x1080 and for all devices with minimum 174 DPI.
  • 180% when the screen resolution is 2560x1440 and for all devices with minimum 240 DPI.

The developer can use vectorial elements like SVG or XAML without problems.

Otherwise when the developer uses the images raw, bitmap, png or jpg, he needs to create a file for every case.

He can explicit the scale factor in the file extension:
\myLogo.scale-100.jpg
\myLogo.scale-140.jpg
\myLogo.scale-180.jpg

Or use the folder convention:
\scale-100\myLogo.jpg
\scale-140\myLogo.jpg
\scale-180\myLogo.jpg

When the application don't has static images, it's possible to create a logic to have the same result from code behind.
switch (DisplayProperties.ResolutionScale)
{
case ResolutionScale.Scale100Percent:
img.Source = new BitmapImage(new Uri("url?s=100"));
break;
case ResolutionScale.Scale140Percent:
img.Source = new BitmapImage(new Uri("url?s=140"));
break;
case ResolutionScale.Scale180Percent:
img.Source = new BitmapImage(new Uri("url?s=180"));
break;

default:
// some exception
}

The class DisplayProperties has some event to help the developer:
  • ColorProfileChanged: when the color profile changes.
  • LogicalDpiChanged: when the the pixel per inches (PPI) changes.
  • OrientationChanged: when device orientation changes.
  • StereoEnabledChanged: when the property StereoEnabled changes (3D stereoscopic).


Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in c#, csharp, developers, microsoft, silverlight, windows 8, windows RT | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Happy New Year!
    Posted by Lawrence Chang, Product Marketing Manager, Google mobile team When I first asked the mobile team to send me pictures of how they r...
  • XMAS TIME - Get a Lumia 925 for free
    Do you want a Lumia 925 for Christmas? Thanks to DVLUP you can get it easy :) Check the new xmas challenge ! You just need to create 3 new ...
  • Our 5 favourite new Windows Phone apps of the week
    Today myMoneyBook is featured in Nokia's blog:  Our 5 favourite new Windows Phone apps of the week . Thank you so much  Nokia !
  • Mobile Web Calendar for iPhone and Android, now with event management
    It's probably no news to all you parents out there, but as a new dad I only recently found out just how busy life gets with kids. So I w...
  • Windows Phone 8 - Map and Clusters
    This code example demonstrates how to dynamically group pushpins in the map control. There is a lot of code for Windows Phone 7, then I merg...
  • Places Directory app for Android
    As an engineer based in Taipei, I frequently travel to Google headquarters in Mountain View. When I'm there, I'm always looking for...
  • The Iterative Web App - Faster Address Auto-complete and Keyboard Shortcuts
    On April 7th, we announced a new version of Gmail for mobile for iPhone and Android-powered devices. Among the improvements was a complete...
  • Our newest Mobile Search feature: Where am I?
    Many of our improvements to search quality come from analyzing actual search queries. We’re constantly trying to surface more relevant sea...
  • [ITA] Dal 920 al Lumia 1020
    Che dire... Il Lumia 1020 subentra di prepotenza con il suo colore giallo. La prima impressione รจ sicuramente molto positiva, non solo per l...
  • Impressions of CES
    Posted by Lawrence Chang, Product Marketing Manager, Google mobile team As the 2008 Consumer Electronics Show winds to a close, some of you...

Categories

  • 100th post
  • 3D
  • 6210 navigator
  • 6220 classic
  • adsense
  • adsense for mobile
  • alexandra's mobile [ad]itude
  • Amber
  • android
  • android market
  • android widget
  • app
  • appdeals
  • apphub
  • apple
  • apps
  • att
  • autocomplete
  • best buy mobile
  • better know your mobile
  • biking directions
  • BlackBerry
  • BlackBerry Storm
  • blackjack
  • blogger
  • brightpoint
  • bug
  • buxfer
  • Buzz
  • buzz for mobile
  • c#
  • cab4me
  • Calendar
  • Caliburn
  • canada
  • CES
  • check-in
  • chi-2008
  • clearwire
  • cloud print
  • Clusters
  • Coding4fun
  • Contacts
  • convenience key
  • countdown to 2009
  • coupons
  • csharp
  • culture
  • dennis woodside
  • developers
  • Docs
  • Doodle
  • doodles
  • dotorg
  • doubleclick mobile
  • droid
  • DVLUP
  • e-series
  • ebook
  • election
  • enterprise
  • feature phones
  • france
  • free
  • g1
  • geo
  • geolocation api
  • germany
  • Gesture search
  • gmail
  • gmail for android
  • gmail for mobile
  • GOOG-411
  • googe search
  • Google
  • Google Africa
  • google analytics
  • Google Apps
  • Google Apps Blog
  • google apps device policy
  • google apps for mobile
  • google book search
  • google buzz
  • google buzz for mobile
  • Google Custom Search
  • google docs
  • google earth
  • google finance
  • google gears for mobile
  • google goggles
  • Google I/O
  • google instant
  • google latitude
  • google local search
  • Google Location Alerts
  • google location history
  • Google Locaton History
  • google maps
  • google maps for mobile
  • google maps navigation
  • google mobile
  • google mobile ads
  • google mobile help
  • google mobile help forum
  • Google Mobile Search
  • google mobile tips
  • google mobile tricks
  • google moderator
  • Google News
  • google offers
  • google product search
  • Google profile
  • Google public location badge
  • google search
  • google search app
  • google search by voice
  • google search for mobile
  • google shopper
  • google sites
  • google sky map
  • Google SMS
  • google suggest
  • google sync
  • google talk
  • google toolbar
  • google translate
  • google translate for animals
  • google voice
  • google wallet
  • google+
  • googlenew
  • gps
  • hangouts
  • history
  • honeycomb
  • hot
  • hotpot
  • html 5
  • i-mode
  • igoogle
  • image ads
  • image search
  • inside search
  • Interative web app
  • iOS
  • ipad
  • iphone
  • ipod touch
  • italy
  • iterative web app
  • Iterative Webapp
  • J2ME
  • jason spero
  • lambda
  • latitude api
  • layers
  • Listen
  • Local Business Center
  • local inventory
  • local search
  • locale
  • location based search
  • location tag
  • Lumia 1020
  • Lumia 925
  • mac
  • macworld
  • Mail
  • Maps
  • marketplace
  • mary meeker
  • meow me now
  • microsoft
  • mobile
  • mobile [ad]itude
  • mobile advertising
  • mobile calendar
  • mobile tricks
  • mobile world congress
  • mobile.google.com
  • moneybook
  • motorola
  • movies
  • music
  • MVVM
  • my location
  • my tracks
  • myBattery
  • mymoneybook
  • n-series
  • n78
  • n95
  • n96
  • navigation
  • new york city
  • nexus
  • nfc
  • nokia
  • Nokia Pro Camera
  • NowPlaying
  • ntt docomo
  • NuGet; Visual Studio
  • nyc
  • open handset alliance
  • opera
  • opera mini
  • opera mobile
  • orkut
  • outbox
  • palm
  • palm webos
  • Panoramio
  • personalized suggest
  • Picasa web albums
  • Place Pages for mobile
  • Places
  • Places Directory
  • pre
  • product ideas
  • product search
  • produt search for mobile
  • quick search box
  • Reader
  • registration
  • research
  • s60
  • samsung
  • santa
  • search
  • search by voice
  • Search Options
  • sharing
  • shortcut
  • sidekey
  • silverlight
  • sky lab
  • smart navigation
  • social
  • Sony
  • sony ericsson
  • spain
  • Spreadsheeets
  • sprint
  • sql ce
  • sqlite
  • starring
  • stars
  • street view
  • Summer Games
  • symbian
  • Sync
  • Syncfusion
  • t-mobile
  • tablet
  • tasks
  • TechNet
  • TechNet wiki
  • telerik
  • Thomson
  • TileView
  • tips
  • transit
  • uiq
  • uk
  • universal search
  • verizon
  • visual search
  • voice actions
  • voice search
  • vote
  • walking directions
  • walking navigation
  • web app
  • wep app
  • wikininjas
  • windows 8
  • windows mobile
  • windows phone
  • Windows Phone 7.8
  • Windows phone 8
  • windows RT
  • Windows Store
  • wireless week
  • xaml
  • xna
  • youtube
  • youtube channel
  • YouTube for mobile
  • zoho

Blog Archive

  • ►  2013 (21)
    • ►  November (3)
    • ►  October (1)
    • ►  September (3)
    • ►  August (3)
    • ►  July (2)
    • ►  June (4)
    • ►  April (1)
    • ►  March (1)
    • ►  February (2)
    • ►  January (1)
  • ▼  2012 (32)
    • ►  December (2)
    • ▼  November (3)
      • myTasks for Windows Phone
      • NowPlaying for Windows Phone
      • Windows 8 - Images and DPI
    • ►  October (3)
    • ►  September (6)
    • ►  August (1)
    • ►  June (1)
    • ►  May (2)
    • ►  April (3)
    • ►  March (5)
    • ►  February (5)
    • ►  January (1)
  • ►  2011 (98)
    • ►  December (8)
    • ►  November (9)
    • ►  October (6)
    • ►  September (7)
    • ►  August (2)
    • ►  July (12)
    • ►  June (7)
    • ►  May (11)
    • ►  April (8)
    • ►  March (12)
    • ►  February (9)
    • ►  January (7)
  • ►  2010 (122)
    • ►  December (18)
    • ►  November (10)
    • ►  October (8)
    • ►  September (10)
    • ►  August (10)
    • ►  July (4)
    • ►  June (11)
    • ►  May (7)
    • ►  April (14)
    • ►  March (13)
    • ►  February (10)
    • ►  January (7)
  • ►  2009 (109)
    • ►  December (7)
    • ►  November (14)
    • ►  October (14)
    • ►  September (6)
    • ►  August (7)
    • ►  July (9)
    • ►  June (13)
    • ►  May (10)
    • ►  April (7)
    • ►  March (7)
    • ►  February (11)
    • ►  January (4)
  • ►  2008 (92)
    • ►  December (11)
    • ►  November (7)
    • ►  October (9)
    • ►  September (6)
    • ►  August (6)
    • ►  July (11)
    • ►  June (12)
    • ►  May (4)
    • ►  April (8)
    • ►  March (5)
    • ►  February (5)
    • ►  January (8)
  • ►  2007 (9)
    • ►  December (6)
    • ►  November (3)
Powered by Blogger.

About Me

Unknown
View my complete profile