Package com.ms.com.directX Previous
Previous
Microsoft Packages
Microsoft Packages
Index
Index
Next
Next

Class ddPalette

Applications use the methods of the ddPalette class to create DirectDraw palette objects and work with system-level variables.

public class ddPalette implements IddPalette
{
  public void InternalSetObject(IUnknown lpddp);
  public IUnknown InternalGetObject();
  public void Initialize(dDraw val);
  public int GetCaps();
  public Color[] GetColorEntries(int flags, int start, int count);
  public void GetEntries(int flags, int start, int count, byte[] val);
  public PaletteEntry[] GetPaletteEntries(int flags, int start, int count);
  public void SetEntries(int flags, int start, int count, byte[] val);
  public void SetEntries(int flags, int start, int count, Color c[]);
  public void SetEntries(int flags, int start, int count, PaletteEntry pe[]);
  public void InternalAttachDD(dDraw dd);
}

The methods can be organized into the following groups:
Allocating memory Initialize
Palette capabilities GetCaps
Palette entries GetColorEntries
GetEntries
GetPaletteEntries
SetEntries

GetCaps

public int GetCaps();

Retrieves the capabilities of this palette object.

Return Value:

Returns one value of DDPCAPS_ type.


GetColorEntries

public Color[] GetColorEntries(int flags, int start, int count)

Queries palette values from a ddPalette object and returns the color values associated with each entry.

Return Value:

Returns an array that contains the color values for the requested entries.

ParameterDescription
flags Reserved; must be 0.
start Start of the entries that should be retrieved sequentially.
count Number of palette entries to retrieve. The colors of each palette entry are returned in sequence, from the value of the start parameter through the value of the count parameter minus 1.

See Also: GetEntries, GetPaletteEntries


GetEntries

public void GetEntries(int flags, int start, int count, byte[] val);

Queries palette values from a ddPalette object.

Return Value:

No return value.

ParameterDescription
flags Reserved; must be 0.
start Start of the entries that should be retrieved sequentially.
count Number of palette entries that can fit in the object specified val. The colors of each palette entry are returned in sequence, from the value of the start parameter through the value of the count parameter minus 1.
val Array variable that receives the palette entries. The palette entries are 1 byte each if the DDPCAPS_8BITENTRIES flag is set, and 4 bytes otherwise. Each field is a color description.

See Also: SetEntries


GetPaletteEntries

public PaletteEntry[] GetPaletteEntries(int flags, int start, int count)

Queries palette values from a ddPalette object and returns a PaletteEntry object representing each entry.

Return Value:

Returns an array of objects that contain the requested entries.

ParameterDescription
flags Reserved; must be 0.
start Start of the entries that should be retrieved sequentially.
count Number of palette entries to retrieve. Each palette entry is returned in sequence, from the value of the start parameter through the value of the count parameter minus 1.

See Also: GetColorEntries, GetEntries


Initialize

public void Initialize(dDraw val);

Initializes the ddPalette object.

Return Value:

No return value.

ParameterDescription
val The DirectDraw object.


SetEntries

public void SetEntries(int flags, int start, int count, byte[] val);

Changes entries in a ddPalette object immediately. The palette must have been attached to a surface by using the SetPalette method before SetEntries can be used.

Return Value:

No return value.

ParameterDescription
flags Reserved; must be 0.
start First entry to be set.
count Number of palette entries to be changed.
val Array variable that contains the palette entries. The palette entries are 1 byte each if the DDPCAPS_8BITENTRIES flag is set and 4 bytes otherwise. Each field is a color description.

See Also: GetEntries, SetPalette


SetEntries

public void SetEntries(int flags, int start, int count, Color c[])

Changes entries in a ddPalette object immediately. The palette must have been attached to a surface by using the SetPalette method before SetEntries can be used.

Return Value:

No return value.

ParameterDescription
flags Reserved; must be 0.
start First entry to be set.
count Number of palette entries to be changed.
val Array variable that contains the new color values for each entry.

See Also: GetEntries, SetPalette


SetEntries

public void SetEntries(int flags, int start, int count, PaletteEntry pe[])

Changes entries in a ddPalette object immediately. The palette must have been attached to a surface by using the SetPalette method before SetEntries can be used.

Return Value:

No return value.

ParameterDescription
flags Reserved; must be 0.
start First entry to be set.
count Number of palette entries to be changed.
val Array variable that contains the PaletteEntry objects that define the new values for each entry.

See Also: GetEntries, SetPalette



Top© 1996 Microsoft Corporation. All rights reserved.