UiImageRenderer

Renders a Guinevere UI straight to an image with no GPU involvement — for the Studio preview panel, the ui CLI verb, tests, and golden-image comparisons. The realtime path is UiRuntime.

Public Methods

RenderPng

public static byte[] RenderPng(Action<Gui> build, int width, int height, SKColor? background = null, float deltaTime = 0f)

Runs one two-pass UI frame and returns it as a PNG.

Parameters:

  • build (Action): Builds the UI; invoked once per pass, so it must be idempotent.
  • width (int): Image width in pixels, greater than zero.
  • height (int): Image height in pixels, greater than zero.
  • background (SKColor?): Fill color; transparent by default. (Default: null)
  • deltaTime (float): Seconds since a notional previous frame, for time-based animation. (Default: 0f)

Returns: byte[]

  • PNG-encoded bytes.