PowerPoint in XNA

This sample might be considered strange…

The sample shows a content pipeline extension that allows you to add PowerPoint presentations (.ppt) in your game, and display them as a slide-show inside your XNA application.

The Power Point Importer and processor take care of transforming a .ppt file into a series of images that can then be loaded as textures. The output of this processor is a class named XNAPowerPointShow, which holds the collection of textures accessible at runtime.

The Power Point Processor also accepts two parameters. These parameters specify which solid color to be used as a background, and how opaque the background is supposed to be at runtime.

A few notes:

  • when building the content, some .png files will be created in your Content folder, for each slide in the PowerPoint file. These are build by the processor, and then referenced, in order to be transformed into textures by the content pipeline. These should be removed after the build operation is done, but I’m not sure how to do that, or if it will interfere with the rest of the Content build process
  • The processor uses some COM components belonging to Microsoft Office 2007, so you need to have this installed in order to build the sample
  • It is recommended that the .ppt file has a solid color as the background.
  • I couldn’t test it on the Xbox for several reasons, but there shouldn’t be any problems.

To exemplify the coolness factor of this sample, I made a particle system run in the background of the slides. I used Mitch Walker’s Gamefest presentation for this. The results can be seen below:

PowerPoint 2008-10-29 02-15-28-94 PowerPoint 2008-10-29 02-15-37-43

To control the slides, you can use :

  • Keyboard Right/PageDown; Gamepad A,DPadRight, Right Button to advance the slides
  • Keyboard Left/PageUp; Gamepad B, DPadLeft, Left Button to go back to the previous slide

The sample is available below:

  • xnappt_background.zip – the slides drawn over a 3D animated particle system. This requires either and Xbox, or a 3D card compatible with SM 3.0, which supports vertex textures
  • xnappt_cornflowerblue.zip – the slides drawn over our favorite color. For those who can’t run the above project.
  • Pingback: 12 Months, 12 Samples » October Sample: ppt in XNA

  • http://thegamedevspace.spaces.live.com/ Simon (Darkside) Jackson

    Fantastic stuff as always Catalin, great way to show it’s not only graphics tools you can use as source content for our games!

  • http://www.Hilva.com Mahdi Khodadadi Fard

    Excellent job Catalin.

  • http://www.xnainfo.com Rim

    I thought I misread when I saw PPT in XNA on my feedreader :) Great stuff!

  • http://www.preanima.com MrLeebo

    Wow, that is extremely creative!

  • http://coldacid.net Chris Charabaruk

    I wonder how many GDC presentations are going to be run from Xboxes in 2009, thanks to this.

  • http://www.catalinzima.com Catalin Zima

    That’d be a nice thing to see ..

    Xbox + this sample + SceneIt! Controller = Win :)

  • carlos

    yesterday I was thinking in something like this to use
    in a presentation of a videogame :o

    i’ll be cool do the presentation and playing the videogame like “picture in picture” with some swap chain :P

  • http://www.catalinzima.com Catalin Zima

    You can do it via RenderToTexture, no swap chain necessary :)

  • carlos

    :o i will try :o

  • http://www.tredent.com/riverbed/wan-acceleration.php www.tredent.com

    I’ ve had occasion to try out taksi, it worked well for GDI capture, but for Direct3D capture on the engine I used it failed in CTaksiDX9:: GetFrame during GetRenderTargetData. I’ ve found a solution by disabling the avi feature (I didn’ t need it) and using screen capture through the texture api with a direct surface to file save- I used D3DXSaveSurfaceToFile. GetRenderTargetData failed with INVALIDCALL- I didn’ t investigate further, but your comments and the msdn documentation suggest it could happen due…

  • Herman

    I was just wondering is it possible to do the same with just a directory with graphic images? Im trying to do an slide show with XNA but I havent found how to load images at random from disk. Also I want to get rid of the images in memory after a while.

    Needless to say Im pretty unexperienced in xna although I know my way around c++ and flash.

  • http://www.catalinzima.com Catalin Zima

    you can use Texture2D.LoadFromFile() on windows.

  • Pingback: 12 Months, 12 Samples » 12 months, not quite 12 samples

  • Cil

    This way shows up animations and transitions pre maded on .ppt?

  • Catalin ZZ

    Nope, no animations and transitions. Just the static slides.

  • Jerry Bradshaw

    Great article!!!