ImageEn, unit hyieutils

IEPromptForColor

IEPromptForColor


Declaration


// Full color palette overload
function IEPromptForColor(var AColor : TColor): Boolean; overload;

// Select from palette overloads
function IEPromptForColor(var AColor : TColor; Palette: array of TRGB; NumCol: integer): Boolean; overload;
function IEPromptForColor(var AColor : TColor; Palette: PRGBROW; NumCol: integer): Boolean; overload;


Description


Display a color selction dialog so the user can choose a color. Result is false if user cancels out.
With first overload the standard VCL Color dialog is used allow selection from full color palette.
With second overload, an ImageEn dialog is used allowing only choices from the specified palette.


Example


// Prompt to specify a fill color for the current layer
var
  aColor: TColor;
begin
  aColor := ImageEnView1.CurrentLayer.FillColor;
  if IEPromptForColor( aColor ) then
    ImageEnView1.CurrentLayer.FillColor := aColor;
  ImageEnView1.Update();
end;

// Select a color used in the image
if IEPromptForColor( aColor, ImageEnView1.IO.Params.ColorMap^, ImageEnView1.IO.Params.ColorMapCount ) then
  Panel1.Color := aColor;

// Show the palette of the file "myfile.gif"
ImageEnView1.IO.LoadFromFile('C:\myfile.gif');
IEPromptForColor( aColor, ImageEnView1.IO.Params.ColorMap^, ImageEnView1.IO.Params.ColorMapCount );


See Also


- TImageEnPaletteDialog