Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function captureElementScreenshot

    • Capture a rendered element as a PNG buffer.

      The viewer's own renderer canvas is captured through PostProcessingManager.renderToImageData(), which renders a fresh frame through the full post-processing chain and reads its target back on both WebGL and WebGPU. Other elements (notably embed/host canvases) retain the composited element-screenshot route, with unrelated DOM hidden without reflow. New pixel-measurement specs should use this helper or one of its consumers, never a hand-rolled 2D-context readback. Multi-sample scalar sweeps should call renderToImageData() in-page and reduce each ImageData there instead of round-tripping every full frame.

      Framebuffer captures return drawing-buffer pixels. Pin ?dpr=1 when pixel counts or exact sample locations must not vary with adaptive DPR. timeout bounds element readiness; the render/readback remains bounded by the test.

      Parameters

      Returns Promise<Buffer<ArrayBufferLike>>