ScreenCapture
ConsoleMonster.Interactive
Draws prompts, menus and forms into memory instead of the terminal and keeps every frame: for scripted demos, documentation screenshots and exports (ConsoleExporter.ToHtml(capture.LastFrame)). Set it on InteractiveOptions.Capture together with a scripted InteractiveOptions.Input.
Inheritance
- object
- ScreenCapture
Usage
Explore 6 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 2
- Property InteractiveOptions.Capture
- Property RecordingTarget.Screens
Accepted by parameters 4
- Method ScriptedInput.WaitForOutput
- Extension method InteractiveOptions.Capture
- Method InteractiveOptionsFluent.Capture
- Method TestTerminal.Interactive
Constructors
public ScreenCapture(int width, int height, bool inline = false) #Creates a capture of a fixed size.
Parameters
- width int
- Width in cells.
- height int
- Height in cells.
- inline bool = false
- Whether prompts draw as they would in the scrollback (true) or on a full screen (false).
Methods
public CellBuffer? FindFrame(string text) #The first frame whose text contains a phrase (for picking a screen to export), or null.
Parameters
- text string
- The phrase.
public void Hold(TimeSpan duration) #Records an additional playback pause after the last captured frame.
Parameters
- duration System.TimeSpan
- A nonnegative pause; zero does nothing.
public List<RecordedFrame> ToRecordedFrames(TimeSpan frameDuration, TimeSpan lastFrameHold = default) #The captured screens as an animation timeline: each frame shows for frameDuration plus its ScreenCapture.FrameHolds, and the last one for lastFrameHold more. Export it with Recording.Render (HTML player, animated SVG, asciicast) or SaveGraphics in ConsoleMonster.Graphics (GIF, APNG).
Parameters
- frameDuration System.TimeSpan
- How long each frame shows (at least one millisecond).
- lastFrameHold System.TimeSpan = default
- Extra time on the last frame before the animation loops or ends.
Inherited Methods
Properties
public IReadOnlyDictionary<int, TimeSpan> FrameHolds { get; } #Additional playback pauses after each zero-based frame index. Capturing a pause never sleeps.