[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'FPimage' (#fcl)

TFPPalette

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

FreePascal color palette class; base for LCL TPalette etc.

Declaration

Source position: fpimage.pp line 68

type TFPPalette = class

protected

  FData: PFPColorArray;

  

FData - local variable to hold data as a Colour Array

  FCount: Integer;

  

FCount - local variable to hold number of colours in array

  FCapacity: Integer;

  

FCapacity - local variable to hold total capacity of array

  procedure SetCount(); virtual;

  

Set the number of colors in the palette.

  function GetCount;

  

Get the number of used palette entries.

  procedure SetColor(); virtual;

  

Set the color of the specified palette entry.

  function GetColor();

  

Get the color of the specified palette entry.

  procedure SetCapacity();

  procedure CheckIndex(); virtual;

  

Perform an bounds check of the supplied index.

  procedure EnlargeData; virtual;

  

Makes room in the array for more palette entries.

public

  constructor Create();

  

Creates a palette with ACount color entries.

  destructor Destroy; override;

  

Destroys this instance.

  procedure Build(); virtual;

  

Builds the palette from an Image.

  procedure Copy(); virtual;

  

Replace the color table by a copy of APalette.

  procedure Merge(); virtual;

  

Merge the contents of the given palette into the current palette.

  function IndexOf(); virtual;

  

Returns the palette index of the given color.

  function Add(); virtual;

  

Add the given color to the palette, and return its palette index.

  procedure Clear; virtual;

  

Empties the palette.

  property Color: TFPColor; default; [rw]

  

The current Color from the palette

  property Count: Integer; [rw]

  

Get or set the number of used palette entries.

  property Capacity: Integer; [rw]

end;

Inheritance

TFPPalette

  

FreePascal color palette class; base for LCL TPalette etc.

|

TObject

Description

[entire review 2010-13-01 DoDi]

The latest version of this document can be found at lazarus-ccr.sourceforge.net.