Declaration
function AcquireSourceToStr(AcquireSource : TIEAcquireSource) : string;
Description
Convert a
TIEAcquireSource to a string formatted as follows:
Device Name||Index of Location||API||Device Type
E.g. My Cool Scanner||3||TWN||SCN
// Save the current acquisition source to the registry
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
var
sDevice : string;
begin
...
// Read the selected device
sDevice := AcquireSourceToStr( ImageEnMView1.MIO.SelectedAcquireSource );
WRegistry.WriteString( 'SelectedAcquireSource', sDevice );
...
end;
// Read the current acquisition source to the registry
procedure TMainForm.FormShow(Sender: TObject);
var
sDevice : string;
ADevice : TIEAcquireSource;
begin
...
// Restore the device selection
sDevice := WRegistry.ReadString( 'SelectedAcquireSource', '' );
if sDevice <> '' then
begin
ADevice := StrToAcquireSource( sDevice );
ImageEnView1.IO.SetAcquireSource( ADevice.Api, ADevice.Location );
Label1.Caption := 'Scanner: ' + ADevice.Name;
end;
...
end;
See Also
◼StrToAcquireSource