NewGamePhysics.Utilities.Screenshot Class Reference

Svaes the screen as an image. More...

List of all members.

Public Member Functions

 Screenshot ()
 Creates an instance of the Screenshot class and initializes the save path. Creates the folder if not already there.
void TakeScreenshot (GraphicsDevice graphiceDevice)
 Take a screenshot of the specified graphics device.

Detailed Description

Svaes the screen as an image.

Definition at line 17 of file Screenshot.cs.


Constructor & Destructor Documentation

NewGamePhysics.Utilities.Screenshot.Screenshot (  ) 

Creates an instance of the Screenshot class and initializes the save path. Creates the folder if not already there.

Definition at line 43 of file Screenshot.cs.

00044         {
00045             screenshotPath = System.Windows.Forms.Application.StartupPath + "\\Screenshots";
00046             if (!System.IO.Directory.Exists(screenshotPath))
00047             {
00048                 System.IO.Directory.CreateDirectory(screenshotPath);
00049             }
00050         }


Member Function Documentation

void NewGamePhysics.Utilities.Screenshot.TakeScreenshot ( GraphicsDevice  graphiceDevice  ) 

Take a screenshot of the specified graphics device.

Parameters:
device 

Definition at line 56 of file Screenshot.cs.

00057         {
00058             if (fileSaved.WaitOne(1000))
00059             {
00060                 fileSaved.Reset();
00061                 int w = graphiceDevice.PresentationParameters.BackBufferWidth;
00062                 int h = graphiceDevice.PresentationParameters.BackBufferHeight;
00063                 screenshotTexture = new ResolveTexture2D(graphiceDevice, w, h, 1, SurfaceFormat.Bgr32);
00064                 graphiceDevice.ResolveBackBuffer(screenshotTexture);
00065                 Thread newThread = new Thread(ScreenshotThread);
00066                 newThread.Start();
00067             }
00068         }


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2