ShyyTAUI/src/lib/taDocs/3-client-loadImage.md

1.6 KiB

The taClient.loadImage() method

This documents the taClient.loadImage() method.

info
Async: This is a method you would want to use await with

This method has input parameters. The function could easily be defined as:

async function loadImage(tournamentId: string, bitmap: Uint8Array, userIds: string[]): Promise<ResponseFromUser[]> {
    // backend logic
}

Parameters:

  • tournamentId (string): The GUID of the tournament
  • bitmap (Uint8Array): The image data as a Uint8Array (binary bitmap data)
  • userIds (string[]): An array of user GUIDs for whom the image should be loaded

General usage:

const responses: ResponseFromUser[] = await taClient.loadImage(tournamentGuid, imageBuffer, [userGuid1, userGuid2]);

If you have not yet, please read Client -> Introduction to the Client

Standard Response:

The method returns an array of ResponseFromUser objects, each containing:

{
    userId: 'user-guid-1',
    response: {
        details: {
            loadImage: Response_LoadImage,
            oneofKind: 'loadImage'
        },
        respondingToPacketId: 'packet-guid-uuidv4',
        type: Response_ResponseType
    }
}
info
Note: This method is used in conjunction with StreamSync and related overlay systems to load custom images for display. After loading the image, you can call `showLoadedImage()` to display it.