23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In the table, note that 80% scale tile graphics are used in specific cases like low DPI modes (generally<br />

when the DPI is less than 130 and the resolution is less than 2560 x 1440) and should be provided with<br />

other scaled images. Note also that there are additional graphics besides the Packaging Logo (first item<br />

in the table) that you’ll need when uploading an app to the Windows Store. See the App images topic in<br />

the docs under “Promotional images” for full details.<br />

When saving these files, append .scale-80, .scale-100, .scale-140, and .scale-180 to the filenames,<br />

before the file extension, as in splashscreen.scale-140.png. This allows you, both in the manifest and<br />

elsewhere in the app, to refer to an image with just the base name, such as splashscreen.png, and<br />

Windows will automatically load the appropriate variant for the current scale. Otherwise it looks for one<br />

without the suffix. No code needed! This is demonstrated in the HereMyAm3b example, where I’ve<br />

added all the various branded graphics (with some additional text in each graphic to show the scale). To<br />

test these different graphics, use the set resolution/scaling button in the simulator—refer to Figure 2-5<br />

in Chapter 2—to choose different pixel densities on a 10.6” screen (1366 x 768 =100%, 1920 x 1080 =<br />

140%, and 2560 x 1440 = 180%). You’ll also see the 80% scale used on the other display choices,<br />

including the 23” and 27” settings. In all cases, the setting affects which images are used on the Start<br />

screen and the splash screen, but note that you might need to exit and restart the simulator to see the<br />

new scaling take effect.<br />

One thing you might also notice is that full-color photographic images don’t scale down very well to<br />

the smallest sizes (store logo and small logo). This is one reason why such logos are typically simpler<br />

with Windows Store app design, which also keeps them smaller when compressed. This is an excellent<br />

consideration to keep your package size smaller when you make more versions for different contrasts<br />

and languages. We’ll see more on this in Chapter 17, “Apps for Everyone.”<br />

Tip Two other branding-related resources you might be interested in are the Branding your Windows<br />

Store app topic in the documentation (covering design aspects) and the <strong>CSS</strong> styling and branding your<br />

app sample (covering <strong>CSS</strong> variations and dynamically changing the active stylesheet).<br />

Activation Event Sequence<br />

As the app host is built on the same parsing and rendering engines as Internet Explorer, the general<br />

sequence of activation events is more or less what a web application sees in a browser. Actually, it’s<br />

more rather than less! When you launch an app from its tile, here’s the process as Windows sees it:<br />

1. Windows displays a splash screen using information from the app manifest.<br />

2. Windows launches the app host, identifying the app to launch.<br />

3. The app host retrieves the app’s Start Page setting (see the Application UI tab in the manifest<br />

editor), which identifies the <strong>HTML</strong> page to load.<br />

4. The app host loads that page along with referenced stylesheets and script (deferring script<br />

loading if indicated in the markup). Here it’s important that all files are properly encoded for<br />

best startup performance. (See the sidebar below.)<br />

101

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!