Hi Ray
So, as it turns out any loading of image layers become the params in TImageEnView by default.
There are two ways to maintain the existing params.
1. Store the params in the TIEBitmap object:
var
ImageHeight, ImageWidth, LayerIndex: Integer;
begin
viewMain.LockUpdate;
viewMain.LayersClear();
// For Layer 0 use the params of the bitmap, rather than the embedded TImageEnIO
viewMain.IEBitmap.ParamsEnabled := True;
viewMain.IO.LoadFromFile('SAM_4783.JPG');
ImageHeight := viewMain.IEBitmap.Height;
ImageWidth := viewMain.IEBitmap.Width;
viewMain.Fit();
Log('Loading image');
Log('EXIF_DateTime: ' + viewMain.IO.Params.EXIF_DateTime);
Log('Loading overlay');
LayerIndex := viewMain.LayersAdd('overlay.png');
viewMain.Layers[LayerIndex].Width := ImageWidth;
viewMain.Layers[LayerIndex].Height := ImageHeight;
viewMain.Layers[LayerIndex].Opacity := 0.5;
viewMain.UnlockUpdate;
viewMain.LayersCurrent := 0;
Log('EXIF_DateTime: ' + viewMain.IO.Params.EXIF_DateTime);
end;
2. Store desired params in an object and assign them back after loading:
var
ImageHeight, ImageWidth, LayerIndex: Integer;
params: TIOParams;
begin
params := TIOParams.Create();
viewMain.LockUpdate;
viewMain.IO.LoadFromFile('SAM_4783.JPG');
ImageHeight := viewMain.IEBitmap.Height;
ImageWidth := viewMain.IEBitmap.Width;
viewMain.Fit();
// Store image params
params.Assign( viewMain.IO.Params );
Log('Loading image');
Log('EXIF_DateTime: ' + viewMain.IO.Params.EXIF_DateTime);
Log('Loading overlay');
LayerIndex := viewMain.LayersAdd('overlay.png');
viewMain.Layers[LayerIndex].Width := ImageWidth;
viewMain.Layers[LayerIndex].Height := ImageHeight;
viewMain.Layers[LayerIndex].Opacity := 0.5;
viewMain.UnlockUpdate;
viewMain.LayersCurrent := 0;
// Retore image params
viewMain.IO.Params.Assign( params );
Log('EXIF_DateTime: ' + viewMain.IO.Params.EXIF_DateTime);
params.Free;
end;
Nigel
Xequte Software
www.imageen.com