fg_logpal()

Win32 DirectX Fastgraph/Light

Prototype

HPALETTE fg_logpal (int start, int count, void *values);

Function fg_logpal (ByVal start As Long, ByVal count As Long, values() As Any) As Long

function fg_logpal (start, count : integer; var values) : HPALETTE;

Description

The fg_logpal() function creates a 256-color logical palette containing the specified colors. The logical palette will be set up with the system colors (colors 0-9 and 246-255) set to their default values, unless explicitly changed.

Parameters

start is the starting color number to define in the logical palette, between 0 and 255.

count is the number of colors to define, between 0 and 256. The sum of start and count cannot exceed 256. If count is zero, the logical palette will contain the Windows system colors as its first and last ten entries, with the remaining 236 colors undefined.

values is the name of the array containing the color components. The first three bytes of this array must contain the red, green, and blue components for color start, the next three bytes contain the components for color start+1, and so forth. Each RGB color component is a value between 0 and 255. The size of the values array must be at least 3*count bytes.

Return value

A Windows handle to the new logical palette. If an error occurs in creating the logical palette, fg_logpal() returns zero.

Restrictions

none

See also

fg_defpal(), fg_realize(), fg_setdacs(), fg_setrgb()

Examples

Rainbow

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.