For taking screenshots.
View code on GitHub
Namespace: DeltaEngine.GraphicsAssembly: DeltaEngine.Graphics (in DeltaEngine.Graphics.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The ScreenshotCapturer type exposes the following members.
Methods
Name | Description | |
---|---|---|
MakeScreenshot |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void MakeScreenshotOfYellowBackground() { Resolve<Window>().BackgroundColor = Color.Yellow; new DrawingTests.Line(Vector2D.Zero, new Vector2D(1280, 720), Color.Red); RunAfterFirstFrame(() => { var capturer = Resolve<ScreenshotCapturer>(); capturer.MakeScreenshot(ScreenshotFileName); if (!StackTraceExtensions.StartedFromNCrunchOrNunitConsole) Process.Start(ScreenshotFileName); //ncrunch: no coverage else if (capturer is MockScreenshotCapturer) Assert.AreEqual(ScreenshotFileName, (capturer as MockScreenshotCapturer).LastFilename); }); }
See Also