Tao.Platform.Windows SDK Documentation

Wgl.wglGetLayerPaletteEntries Method 

The wglGetLayerPaletteEntries function retrieves the palette entries from a given color-index layer plane for a specified device context.

[Visual Basic]
Public Shared Function wglGetLayerPaletteEntries( _
   ByVal deviceContext As IntPtr, _
   ByVal layerPlane As Integer, _
   ByVal start As Integer, _
   ByVal entries As Integer, _
   ByVal colors As Integer() _
) As Integer
[C#]
public static int wglGetLayerPaletteEntries(
   IntPtr deviceContext,
   int layerPlane,
   int start,
   int entries,
   int[] colors
);

Parameters

deviceContext

Specifies the device context of a window whose layer planes are to be described.

layerPlane

Specifies the overlay or underlay plane. Positive values of layerPlane identify overlay planes, where 1 is the first overlay plane over the main plane, 2 is the second overlay plane over the first overlay plane, and so on. Negative values identify underlay planes, where ?–1 is the first underlay plane under the main plane, ?–2 is the second underlay plane under the first underlay plane, and so on. The number of overlay and underlay planes is given in the bReserved member of the Gdi.PIXELFORMATDESCRIPTOR structure.

start

Specifies the first palette entry to be retrieved.

entries

Specifies the number of palette entries to be retrieved.

colors

Points to an array of Int32's that contain palette RGB color values. The array must contain at least as many structures as specified by .

The color values should be a RGB value as an int in the hexidecimal form of 0x00bbggrr. The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.

Return Value

If the function succeeds, the return value is the number of entries that were set in the palette in the specified layer plane of the window.

If the function fails or when no pixel format is selected, the return value is zero. To get extended error information, call GetLastWin32Error.

Remarks

Each color-index layer plane in a window has a palette with a size 2^n, where n is the number of bit planes in the layer plane. You cannot modify the transparent index of a palette.

Use the wglRealizeLayerPalette function to realize the layer palette. Initially the layer palette contains only entries for white.

The wglSetLayerPaletteEntries function doesn't set the palette entries of the main plane palette. To update the main plane palette, use GDI palette functions.

See Also

Wgl Class | Tao.Platform.Windows Namespace | Gdi.PIXELFORMATDESCRIPTOR | wglRealizeLayerPalette | wglSetLayerPaletteEntries