GetBufferInfo

Retrieves information about a buffer.

Syntax

GetBufferInfo(index: number): TVisibleBufferInfo

Parameters

  • index - A number representing the buffer index.

Return Value

Returns a TVisibleBufferInfo object containing information about the buffer.

Description

The GetBufferInfo method retrieves information about a buffer, such as its label, drawing style, line style, width, color, and visibility. This can be useful for dynamically adjusting buffer properties based on the current state.

See TVisibleBufferInfo for more information about the buffer information structure.

Example

// Get information about buffer 0
const bufferInfo = this.api.GetBufferInfo(0);

// Log buffer properties
console.log(`Buffer Name: ${bufferInfo.name}`);
console.log(`Paint From: ${bufferInfo.paintFrom}`);

// Modify buffer visibility based on a condition
if (bufferInfo.paintFrom > 0) {
  this.api.SetIndexVisibility(0, true);
} else {
  this.api.SetIndexVisibility(0, false);
}

Last updated