MemoryBlock.ColorValue

From Xojo Documentation

Method

MemoryBlock.ColorValue(Offset as Integer, Bits as Integer) As Color

Supported for all project types and targets.

Gets or sets a Color in one of three formats, selected by Bits.

Notes

Bits can take on the following values:

Value Description
32 32-bit color (high byte unused)
24 24-bit color
16 16-bit color (5 bits per color, high bit unused)

Returns a Color. Offset is in bytes from the beginning of the MemoryBlock.

Sample Code

This example stores a color in a MemoryBlock and then accesses it.

Var c As Color
Var m As New MemoryBlock(9)
m.ColorValue(0, 32) = &c43A245

c = m.ColorValue(0, 32)