ImageEn, unit iexColorPalette

TIEColorPalette.LoadFromFile

TIEColorPalette.LoadFromFile


Declaration

procedure LoadFromFile(const Filename: TFileName; Format: Integer = -1);


Description

Loads all colors in a palette file into the control.

The following formats are supported:
 JASC Palette (*.pal, *.psppalette)
 Photoshop ACO (*.aco)
 Photoshop ACT (*.act)

For Format specify one of the following:
Const Value Description
IECP_Fmt_Unknown -1 The file format will be guessed based on the file extension. If it is not recognized, then IECP_Fmt_JASC is assumed
IECP_Fmt_JASC 0 File is loaded as a JASC Palette file
IECP_Fmt_Photoshop_Act 1 File is loaded as a Photoshop ACT file
IECP_Fmt_Photoshop_Aco 2 File is loaded as a Photoshop ACO file

Photoshop ACO format may include names for each of the colors. If a valid TStringList is passed for the Names parameter it will be filled with names.

Raises an exception if the file format is not recognized.


Example

// Prompt user to load colors from a palette file
if OpenDialog1.Execute then
try
  ColorPalette1.LoadFromFile( OpenDialog1.Filename );
except
  ShowMessage( 'File format is unknown!' );
end;


See Also

 LoadPaletteFromFile
 SaveToFile