ImageEn, unit iexdcim

TIEDcimAcquire.SourceNameToIndex

TIEDcimAcquire.SourceNameToIndex


Declaration

function SourceNameToIndex(const sName : string) : Integer;


Description

Return the index of an item in the source list.

sName can be one of the following:
Value Description
Source Name A name for the source as returned by Sources.Name, e.g. 'GT-I8190T Card'
Device Name The device containing a DCIM folder name (as returned by Sources.DeviceName), e.g. 'GT-I8190T'
Path The path of a DCIM folder, e.g. 'I:\DCIM\'
Drive Letter The letter of a connected camera card or device containing a DCIM folder, e.g. 'I'
Blank The default device will be selected


See Also

SelectedSource


Example

// Acquire from the camera card on H drive
Idx := ImageEnView1.IO.AcquireParams.DCIMParams.SourceNameToIndex( 'H' );
if Idx > -1 then
begin
  ImageEnView1.IO.AcquireParams.DCIMParams.SelectedSource := Idx;
  ImageEnView1.IO.AcquireParams.DCIMParams.Acquire( OnGetImage );
end;

// Acquire from the card on the device named, GT-I8190T
Idx := ImageEnView1.IO.AcquireParams.DCIMParams.SourceNameToIndex( 'GT-I8190T Card' );
if Idx > -1 then
begin
  ImageEnView1.IO.AcquireParams.DCIMParams.SelectedSource := Idx;
  ImageEnView1.IO.AcquireParams.DCIMParams.Acquire( OnGetImage );
end;

// Acquire from the first source on the device named, GT-I8190T
Idx := ImageEnView1.IO.AcquireParams.DCIMParams.SourceNameToIndex( 'I8190T' );
if Idx > -1 then
begin
  ImageEnView1.IO.AcquireParams.DCIMParams.SelectedSource := Idx;
  ImageEnView1.IO.AcquireParams.DCIMParams.Acquire( OnGetImage );
end;