ScreenshotCapturer InterfaceDelta Engine Documentation
For taking screenshots. View code on GitHub

Namespace: DeltaEngine.Graphics
Assembly: DeltaEngine.Graphics (in DeltaEngine.Graphics.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public interface ScreenshotCapturer

The ScreenshotCapturer type exposes the following members.

Methods

  NameDescription
Public methodMakeScreenshot
Top
Remarks

Tests: DeltaEngine.Graphics.Tests.ScreenshotCapturerTests
Examples

1 unit tests call DeltaEngine.Graphics.ScreenshotCapturer
[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