Images are irreplaceable in games. They could be the sprites, the game world in 2D or the game user interface. In the 3D world, usually, images represent the appearance of 3D models. In the Windows Phone 7 XNA framework, the default texture or model importers and processors have already dealt with the images for you. Sometimes, you may want to handle the image information as per your needs when loading them from an XNB file. In this recipe, you will learn how to get and operate the image data in the XNA content pipeline.
Carry out the following steps:
1. Create a Windows Phone Game project named
ImageProcessorGame
and changeGame1.cs
toImageProcessorGame.cs
. Add theBackgroundMaze.png
(shownin the following screenshot) into the content project. Then, add a Content PipelineExtension Library into the game solution namedImageProcessor
, and then addImageProcessor.cs
into the project:2. Create the
ImageProcessor...