Microsoft DirectX 8.0 (Visual Basic) |
object.SetPaletteEntries( _ PaletteNumber As Long, _ ArrayOfEntries As Any)
If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
For more information on PALETTEENTRY, see the Microsoft Platform Software Development Kit (SDK). Note that as of Microsoft DirectX® 8.0, the peFlags member of the PALETTEENTRY structure does not work the way it is documented in the Platform SDK. The peFlags member is now the alpha channel for 8-bit palletized formats.
A single logical palette is associated with the device, and is shared by all texture stages.
The following code fragment shows how to call SetPaletteEntries.
Dim device As Direct3DDevice8 Dim pal(255) As PALETTEENTRY 'Pass the first element of the array of palette entries device.SetPaletteEntries 255, pal(0)
Ensure that PaletteNumber matches the size of the passed array of palette entries.
Direct3DDevice8.GetCurrentTexturePalette, Direct3DDevice8.GetPaletteEntries, Direct3DDevice8.SetCurrentTexturePalette, Texture Palettes