// 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;