In This Chapter
Using the Image
element
Capturing and displaying user input with the InkPresenter
Playing audio and video with the MediaElement
Using the XNA SoundEffect
class
Configuring the XNA game loop
Using the MediaLibrary to add music tracks to the Music+Videos Hub
Using the Deep Zoom Composer
Using touch gestures to manipulate a MultiScaleImage
Communicating to and from a web page using the WebBrowser
control
Executing arbitrary JavaScript on a web page with InvokeScript
Storing and viewing offline web content with the WebBrowser
control
The Windows Phone SDK provides a mature set of web and media-related elements. This chapter explores some of the most feature-rich controls present in the XAML toolbox.
This chapter is jam-packed full of examples and begins by looking in depth at the Image
element. The InkPresenter
is discussed, and you see how to create a simple sketch app.
The MediaElement
is also discussed and you see how it is used to play audio and video files stored locally on the phone, or streamed over the Internet. This chapter also examines a sample app that provides you with a test bed for experimenting with the MediaElement
’s main properties.
The chapter looks at leveraging XNA within your XAML-based app to play sound effects more efficiently and at using the new Windows Phone 8 Media Library extensions to add or remove music tracks to and from the Music+Videos Hub. It then explores Deep Zoom to see how the MultiScaleImage
element is used to provide stunning visual experiences while making efficient use of your users’ bandwidth. We delve into a sample client and server application that allows the user to select and manipulate a Deep Zoom image.
Finally, the chapter explores the WebBrowser
control, and you see how to communicate to a web page from your Windows Phone app and vice versa. You also discover how to execute arbitrary JavaScript on a web page to modify CSS styles or to attach new behaviors, and how to store and browse offline content to decrease network usage.
3.145.35.178