Class DirectDrawPalette
public class DirectDrawPalette implements IDirectDrawPalette
{
// Methods
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 setEntriesHalftone(int start, int count);
public void setEntriesSystemPalette(int start, int count);
}
Applications use the methods of the DirectDrawPalette class to create Microsoft® DirectDraw® palette objects and work with system-level variables.
Note This class does not provide an initialize method. Use the DirectDraw.createPalette method to create and initialize DirectDrawPalette objects.
public int getCaps();
Retrieves the capabilities of this palette object.
Return Value:
Returns one value of the DDPCAPS_ type.
public Color[] getColorEntries(int flags, int start, int count);
Queries palette values from a DirectDrawPalette object and returns the color values associated with each entry.
Return Value:
Returns an array that contains the color values for the requested entries.
Parameter | Description |
flags
| Reserved; the value must be 0.
|
start
| The beginning of the entries that should be sequentially retrieved.
|
count
| The 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
public void getEntries(int flags, int start, int count, byte[] val);
Queries palette values from a DirectDrawPalette object.
Return Value:
No return value.
Parameter | Description |
flags
| Reserved; the value must be 0.
|
start
| The beginning of the entries that should be sequentially retrieved.
|
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
| The array variable that receives the palette entries. The palette entries are 1 byte each if the DDPCAPS_8BITENTRIES flag is set; otherwise, entries are 4 bytes each. Each entry is a color description.
|
See Also: setEntries
public PaletteEntry[] getPaletteEntries(int flags, int start, int count);
Queries palette values from a DirectDrawPalette object and returns a PaletteEntry object that represents each entry.
Return Value:
Returns an array of objects that contain the requested entries.
Parameter | Description |
flags
| Reserved; the value must be 0.
|
start
| The beginning of the entries that should be sequentially retrieved.
|
count
| The 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
public void setEntries(int flags, int start, int count, byte[] val);
Immediately changes entries in a DirectDrawPalette object. The palette must have been attached to a surface by using the setPalette method before setEntries can be used.
Return Value:
No return value.
Parameter | Description |
flags
| Reserved; the value must be 0.
|
start
| The first entry to be set.
|
count
| The number of palette entries to be changed.
|
val
| The array variable that contains the palette entries. The palette entries are 1 byte each if the DDPCAPS_8BITENTRIES flag is set; otherwise, entries are 4 bytes each. Each entry is a color description.
|
See Also: getEntries, com.ms.directX.DirectDrawSurface
public void setEntries(int flags, int start, int count, Color c[]);
Immediately changes entries in a DirectDrawPalette object. The palette must have been attached to a surface by using the setPalette method before setEntries can be used.
Return Value:
No return value.
Parameter | Description |
flags
| Reserved; the value must be 0.
|
start
| The first entry to be set.
|
count
| The number of palette entries to be changed.
|
c
| The array variable that contains the new color values for each entry.
|
See Also: getEntries, com.ms.directX.DirectDrawSurface
public void setEntries(int flags, int start, int count, PaletteEntry pe[]);
Immediately changes entries in a DirectDrawPalette object. The palette must have been attached to a surface by using the setPalette method before setEntries can be used.
Return Value:
No return value.
Parameter | Description |
flags
| Reserved; the value must be 0.
|
start
| The first entry to be set.
|
count
| The number of palette entries to be changed.
|
pe
| The array variable that contains the PaletteEntry objects that define the new values for each entry.
|
See Also: getEntries, com.ms.directX.DirectDrawSurface
public void setEntriesHalftone(int start, int count);
Fills the palette in with standard halftone entries.
Return Value:
No return value.
Parameter | Description |
start
| The starting position in the palette to place the values.
|
count
| The number of entries to add to the palette.
|
public void setEntriesSystemPalette(int start, int count);
Fills the entries in the palette with the values in the current system palette.
Return Value:
No return value.
Parameter | Description |
start
| The starting position in the palette to place the values.
|
count
| The number of entries to add to the palette.
|