If Append = False, existing colors in the control are cleared.
With the image source overload, UsedColorsOnly controls whether all colors in the image palette are added, or only those actually used (visible in the image).
// Don't use Windows Bitmaps // Load images in native format ImageEnView1.IO.NativePixelFormat := true; ImageEnView1.IO.LoadFromFile( 'C:\Image.jpeg' ); // Convert to 8bit Palette for display if ImageEnView1.IEBitmap.PixelFormat <> ie8p then ImageEnView1.IEBitmap.PixelFormat := ie8p; IEColorPalette1.AssignPalette( ImageEnView1, False, True );
// ASSIGN A PALETTE FROM A DATABASE THAT CONTAINS R, G AND B COLUMNS var aPalette: array of TRGB; i: integer; begin i := 0; SetLength( aPalette, tblColorList.RecordCount ); tblColorList.First; While not tblColorList.EOF do begin aPalette[ i ].R := tblColorListRed.AsInteger; aPalette[ i ].G := tblColorListGreen.AsInteger; aPalette[ i ].B := tblColorListBlue.AsInteger; inc( i ); tblColorList.Next; end; IEColorPalette1.AssignPalette( aPalette ); end;
// ASSIGN A PALETTE FROM A FILE CONTAINING COLOR VALUES var ssFile: TStringList; begin ssFile := TStringList.Create; ssFile.LoadFromFile( 'D:\MyColors.txt' ); IEColorPalette1.AssignPalette( ssFile ); ssFile.Free; end;
// ASSIGN A DICOM COLOR PALETTE var colorMap: TIEArrayOfTRGB; begin colorMap := GenerateDicomColorPalette( iectHotIron ); ColorPalette1.AssignPalette( colorMap ); end;