Skip to content

Hex1bTerminalSnapshotRegion ​

Namespace: Hex1b.Automation

Assembly: Hex1b.dll

A lightweight view into a terminal snapshot that provides localized coordinates. The region translates local (0,0)-based coordinates to the absolute position in the snapshot.

csharp
public sealed class Hex1bTerminalSnapshotRegion : IHex1bTerminalRegion

Inheritance ​

Object → Hex1bTerminalSnapshotRegion

Implements ​

Properties ​

Bounds ​

The absolute bounds of this region within the parent.

Returns: Rect

csharp
public Rect Bounds { get; }

Height ​

The height of this region.

Returns: Int32

csharp
public int Height { get; }

Width ​

The width of this region.

Returns: Int32

csharp
public int Width { get; }

Methods ​

GetCell(int, int) ​

Gets the cell at the specified position within this region.

Parameters:

  • x (Int32): X coordinate (0 to Width-1).
  • y (Int32): Y coordinate (0 to Height-1).

Returns: TerminalCell

The terminal cell, or if out of bounds.

csharp
public TerminalCell GetCell(int x, int y)

GetRegion(Rect) ​

Gets a sub-region with localized coordinates.

Parameters:

  • bounds (Rect): The bounds of the region to extract, relative to this region.

Returns: Hex1bTerminalSnapshotRegion

A region view that translates local coordinates.

csharp
public Hex1bTerminalSnapshotRegion GetRegion(Rect bounds)

Remarks ​

This is useful for comparing regions of the screen regardless of their absolute position, such as comparing a rendered widget to a known baseline.

Released under the MIT License.