W-CF Documentation - v11.0.0
    Preparing search index...

    Interface BaseScreenshotOptions

    Base screenshot generation options.

    interface BaseScreenshotOptions {
        antiAliasingQuality?: number;
        backgroundColor?: Color4;
        height: number;
        mimeType?: string;
        onAfterRender?: () => void;
        onBeforeRender?: () => void;
        onDrawBackground?: (pContext: CanvasRenderingContext2D) => Promise<void>;
        onDrawOverlay?: (pContext: CanvasRenderingContext2D) => Promise<void>;
        pixelScaleFactor?: number;
        renderAsync?: boolean;
        ssaoQuality?: SSAOQuality;
        targetCanvas?: HTMLCanvasElement;
        width: number;
    }

    Hierarchy (View Summary)

    Index
    antiAliasingQuality?: number

    defines the antialiasing quality, higher is better. (range: [0, 32], default: 32)

    backgroundColor?: Color4

    can be used to override the viewer backgroundColor, for transparent backgrounds a premultiplied alpha color has to be used e.g. (0, 0, 0, 0)

    height: number

    height of the image in pixel

    mimeType?: string

    MIME-Type of the data uri (default: "image/png")

    onAfterRender?: () => void

    callback which will be called after the rendering

    onBeforeRender?: () => void

    callback which will be called before the rendering

    onDrawBackground?: (pContext: CanvasRenderingContext2D) => Promise<void>

    Allows do draw a background for the generated screenshot. Only called if the current background color is transparent.

    onDrawOverlay?: (pContext: CanvasRenderingContext2D) => Promise<void>

    allows do draw an overlay on the generated screenshot

    pixelScaleFactor?: number

    pixel scale factor is used to scale certain elements like 2D text (default: 1.0)

    renderAsync?: boolean

    if true the rendering will be performed asynchronously (default: false)

    ssaoQuality?: SSAOQuality

    can be used to override the viewer ssaoQuality

    targetCanvas?: HTMLCanvasElement

    Optional target canvas. If defined the screenshot will be rendered into this canvas. Viewer.createScreenshot() will return an empty string in this case.

    width: number

    width of the image in pixel