TIEICC.LoadFromFile
Declaration
procedure LoadFromFile(const FileName: string);
Description
Loads a color profile from a file. The file should have an .icc or .icm extension.
Examples
// Load a color profile to apply to the image if one is not available
ImageEnView1.IO.Params.DefaultICCProfile.LoadFromFile('C:\Windows\System32\spool\drivers\color\AdobeRGB1998.icc');
ImageEnView1.IEBitmap.ColorProfileMode := iecpApply;
ImageEnView1.IO.LoadFromFile('C:\input.tif');
// Render image with a custom color profile
ImageEnView1.IEBitmap.ColorProfile.LoadFromFile( 'D:\ColorProfile.icc' );
ImageEnView1.IEBitmap.ColorProfileMode := iecpRender;
ImageEnView1.Update();
// Save a JPEG with the ICC profile, sRGB2014.icc
ImageEnView1.IO.LoadFromFile( 'D:\201849018_A1.jpg' );
ImageEnView1.IO.Params.InputICCProfile.LoadFromFile('D:\sRGB2014.icc');
ImageEnView1.IO.SaveToFile( 'D:\Test_SRGB.jpg' );
// Apply InputICCProfile (VibranceMetallic_8400.icc) color profile to an image and output as OutputICCProfile (Defaults to sRGB)
// Note: This permanently changes the colors of the image
ImageEnView1.IO.LoadFromFile('C:\Wedding.jpg');
ImageEnView1.IO.Params.InputICCProfile.LoadFromFile('C:\VibranceMetallic_8400.icc');
ImageEnView1.IO.Params.InputICCProfile.ConvertBitmap( ImageEnView1.IEBitmap );
ImageEnView1.Update(); // Show changes to bitmap in viewer

// Load the color profile of the current monitor
icc := TIEICC.Create();
icc.LoadFromFile( IEGlobalSettings().CurrentMonitorProfile );
// Do something with icc
icc.Free();
// Display the meta-data for a color profile in TStringGrid
procedure TMainForm.UpdateICCDisplay(const Filename: string);
var
i: Integer;
icc: TIEICC;
begin
// Layout
StringGrid1.ColCount := 2;
StringGrid1.ColWidths[0] := StringGrid1.ClientWidth div 2;
StringGrid1.ColWidths[1] := StringGrid1.ClientWidth div 2;
// Captions
StringGrid1.Cells[0, 0] := 'Property';
StringGrid1.Cells[1, 0] := 'Value';
StringGrid1.Cells[0, 1] := 'Filename';
StringGrid1.Cells[0, 2] := 'Copyright';
StringGrid1.Cells[0, 3] := 'Description';
StringGrid1.Cells[0, 4] := 'InputColorSpace';
StringGrid1.Cells[0, 5] := 'OutputColorSpace';
// Reset values
for i := 1 to StringGrid1.RowCount - 1 do
StringGrid1.Cells[1, 1] := '';
if ( Uppercase( ExtractFileExt( Filename )) = '.ICC' ) or
( Uppercase( ExtractFileExt( Filename )) = '.ICM' ) then
begin
icc := TIEICC.Create();
try
icc.LoadFromFile( Filename );
StringGrid1.Cells[1, 1] := ExtractFilename( Filename );
StringGrid1.Cells[1, 2] := string( icc.Copyright );
StringGrid1.Cells[1, 3] := string( icc.Description );
StringGrid1.Cells[1, 4] := string( icc.InputColorSpace );
StringGrid1.Cells[1, 5] := string( icc.OutputColorSpace );
finally
icc.Free();
end;
end;
end;