@3dsource/metabox-front-api
    Preparing search index...

    Function saveImage

    • Saves an image by triggering a download.

      This function creates an anchor element, sets its href attribute to the provided image URL, and triggers a click event to initiate a download with the specified filename.

      Main exported function to save images from the configurator. Converts base64 image data to actual image files and saves them to the local filesystem.

      Exported utility function that converts base64 screenshot data (from screenshotReady event) to a downloadable image file. Handles the base64 → blob → browser download flow. Import directly from the API package.

      Pattern: api.addEventListener('screenshotReady', (data) => { if(data) saveImage(data, 'config-screenshot.png'); }). Filename extension should match the MimeType passed to GetScreenshot. Import: import { saveImage } from '@3dsource/metabox-front-api'.

      Parameters

      • imageUrl: string

        The URL of the image to save.

      • filename: string

        The name of the file to save.

      Returns void