-
Notifications
You must be signed in to change notification settings - Fork 0
/
DigIt_Source_WIA.pas
639 lines (533 loc) · 20.1 KB
/
DigIt_Source_WIA.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
(*******************************************************************************
** DigIt **
** **
** (s) 2024 Massimo Magnano **
** **
********************************************************************************
** W.I.A. Source **
*******************************************************************************)
unit DigIt_Source_WIA;
{$mode ObjFPC}{$H+}
interface
uses
Windows, Classes, SysUtils,
WIA, WiaDef, WIA_LH, WIA_PaperSizes, WIA_SettingsForm,
Digit_Bridge_Intf;
const
DigIt_Source_WIA_Name = 'WIA Device';
WIA_TakeFileName = 'wia_take';
resourcestring
rsWIAName = 'WIA Device';
rsWIAAcquiring = 'Acquiring Page %d';
rsWIAAcquiringTitle = 'Acquiring from %s';
rsWIAAcquiringTotal = 'Acquiring from %s at %d dpi';
rsWIAAcquired = 'Acquired %d Pages';
rsWIADevItemSel = 'Device found '#13#10'%s %s'#13#10'but Item %s not...'#13#10'Select the First Item %s ?';
rsWIAExcConnect = 'Error Connecting Device';
rsWIAExcNotFound = 'Device not found...';
type
{ TDigIt_Source_WIA }
TDigIt_Source_WIA = class(TNoRefCountObject, IDigIt_Params, IDigIt_ROArray, IDigIt_Source, IDigIt_ProgressCallback)
private
rWIA: TWIAManager;
rWIASource: TWIADevice;
DeviceID,
DeviceName,
DeviceManufacturer,
DeviceItemName: String;
DeviceItemIndex: Integer;
DeviceItem: PWiaItem;
WIACap: TWIAParamsCapabilities;
WIAParams: TArrayWIAParams;
ResMin,
ResMax,
countTakes: Integer;
DownloadedFiles: TStringArray;
rEnabled,
UserCancel: Boolean;
Progress: IDigIt_Progress;
function getWIA: TWIAManager;
function DeviceTransferEvent(AWiaManager: TWIAManager; AWiaDevice: TWIADevice;
lFlags: LONG; pWiaTransferParams: PWiaTransferParams): Boolean;
procedure SelectSourceItem(ASource: TWIADevice; AIndex: Integer);
public
//IDigIt_Params Implementation
function GetFromUser: Boolean; stdcall;
function Duplicate: IDigIt_Params; stdcall;
function Load(const xml_File: PChar; const xml_RootPath: PChar): Boolean; stdcall;
function Save(const xml_File: PChar; const xml_RootPath: PChar): Boolean; stdcall;
function Summary(const ASummary: PChar): Integer; stdcall;
function OnSet: Boolean; stdcall;
//IDigIt_Source Implementation
function Flags: TDigItInterfaceKind; stdcall;
function Init: Boolean; stdcall;
function Release: Boolean; stdcall;
function Enabled: Boolean; stdcall;
function setEnabled(AEnabled: Boolean): Boolean; stdcall;
function Params: IDigIt_Params; stdcall;
function UI_Title(out AUI_Title: PChar): Integer; stdcall;
function UI_ImageIndex: Integer; stdcall;
//Take a Picture and returns FileNames
function Take(takeAction: DigIt_Source_TakeAction; out aDataType: TDigItDataType; out aData: Pointer): DWord; stdcall;
procedure Clear; stdcall;
//IDigIt_ROArray
function GetCount: DWord; stdcall;
function Get(const aIndex: DWord; out aData: Pointer): Boolean; stdcall;
//IDigIt_ProgressCallback
procedure ProgressCancelClick(ATotalValue, ACurrentValue: Integer); stdcall;
constructor Create;
destructor Destroy; override;
end;
implementation
uses Controls, Forms, Dialogs, FileUtil, BGRABitmapTypes, Laz2_XMLCfg,
Digit_Types, Digit_Bridge_Impl;
var
WIAPath_Temp: String;
Source_WIA: TDigIt_Source_WIA = nil;
{ TDigIt_Source_WIA }
function TDigIt_Source_WIA.getWIA: TWIAManager;
begin
//Create WIA
if (rWIA = nil) then
begin
rWIA := TWIAManager.Create;
rWia.OnAfterDeviceTransfer:= @DeviceTransferEvent;
end;
Result :=rWIA;
end;
function TDigIt_Source_WIA.DeviceTransferEvent(AWiaManager: TWIAManager; AWiaDevice: TWIADevice; lFlags: LONG;
pWiaTransferParams: PWiaTransferParams): Boolean;
begin
Result:= not(UserCancel);
if (pWiaTransferParams <> nil) then
Case pWiaTransferParams^.lMessage of
WIA_TRANSFER_MSG_STATUS: begin
if (Progress <> nil) then
begin
Progress.SetCurrentCaption(PChar(Format(rsWIAAcquiring, [AWiaDevice.Download_Count+1])));
Progress.SetCurrentValue(pWiaTransferParams^.lPercentComplete);
Application.ProcessMessages;
end;
end;
WIA_TRANSFER_MSG_END_OF_STREAM: begin
if (Progress <> nil) then
begin
Progress.SetCurrentCaption(PChar(Format(rsWIAAcquired, [AWiaDevice.Download_Count])));
Progress.SetCurrentValue(pWiaTransferParams^.lPercentComplete);
Application.ProcessMessages;
end;
end;
WIA_TRANSFER_MSG_END_OF_TRANSFER: begin
if (Progress <> nil) then
begin
Progress.SetTotal(0, 100, 100, False);
Application.ProcessMessages;
end;
end;
WIA_TRANSFER_MSG_DEVICE_STATUS: begin
end;
WIA_TRANSFER_MSG_NEW_PAGE: begin
//lbProgress.Caption:= AWiaDevice.Download_FileName+AWiaDevice.Download_Ext+' : '+IntToStr(AWiaDevice.Download_Count+1);
end
else begin
// Memo2.Lines.Add('WIA_TRANSFER_MSG_'+IntToHex(pWiaTransferParams^.lMessage)+' : '+IntToStr(pWiaTransferParams^.lPercentComplete)+'% err='+IntToHex(pWiaTransferParams^.hrErrorStatus));
end;
end;
end;
constructor TDigIt_Source_WIA.Create;
begin
inherited Create;
DeviceID:= '';
DeviceItemIndex:= -1;
rWIA:= nil;
rWIASource:= nil;
rEnabled:= True;
countTakes:= -1;
DownloadedFiles:= nil;
end;
destructor TDigIt_Source_WIA.Destroy;
begin
if (rWIA<>nil) then rWIA.Free;
DownloadedFiles:= nil;
inherited Destroy;
end;
procedure TDigIt_Source_WIA.SelectSourceItem(ASource: TWIADevice; AIndex: Integer);
begin
if (ASource <> nil)
then begin
rWIASource:= ASource;
rWIASource.SelectedItemIndex:= AIndex;
DeviceID:= rWIASource.ID;
DeviceItemIndex:= AIndex;
DeviceItem:= rWIASource.SelectedItem;
if (DeviceItem <> nil)
then DeviceItemName:= DeviceItem^.Name
else DeviceItemName:= '';
DeviceManufacturer:= rWIASource.Manufacturer;
DeviceName:= rWIASource.Name;
rWIASource.GetResolutionsLimit(ResMin, ResMax);
end
else begin
DeviceID:= '';
DeviceItemIndex:= -1;
DeviceItem:= nil;
DeviceItemName:= '';
DeviceManufacturer:= '';
DeviceName:= '';
ResMin:= 0;
ResMax:= 0;
end;
end;
function TDigIt_Source_WIA.GetFromUser: Boolean; stdcall;
var
newItemIndex,
newDeviceIndex: Integer;
newWIASource: TWIADevice;
initPar: TInitialItemValues;
begin
Result :=False;
if (getWIA <> nil) then
try
rWia.EnumAll:= False;
//Open the Select Device Dialog
newDeviceIndex:= rWia.SelectDeviceDialog;
if (newDeviceIndex > -1) then
begin
//Select the Device
rWia.SelectedDeviceIndex:= newDeviceIndex;
newWIASource:= rWia.SelectedDevice;
if (newWIASource = nil) then raise Exception.Create(rsWIAExcConnect);
//if not(newWIASource.GetParamsCapabilities(WIACap) then raise Exception.Create('Error Get Params Capabilities');;
newItemIndex:= newWIASource.SelectedItemIndex;
//If Device is different start with Default Values { #note 5 -oMaxM : Store Params for others devices in XML? }
if (DeviceID <> newWIASource.ID)
then initPar:= initDefault
else initPar:= initParams;
//Select Scanner Item and Settings to use
Result:= TWIASettingsSource.Execute(newWIASource, newItemIndex, initParams, WIAParams);
if Result
then SelectSourceItem(newWIASource, newItemIndex);
end;
finally
end;
end;
function TDigIt_Source_WIA.OnSet: Boolean; stdcall;
var
curSource: TWIADevice;
curItem: PWIAItem;
curItemName: String;
aIndex: Integer;
begin
if (getWIA <> nil) then
try
rWia.EnumAll:= False;
aIndex:= -1;
if (DeviceID <> '') or ((DeviceManufacturer <> '') and (DeviceName <> '')) then
repeat
Application.ProcessMessages;
rWia.RefreshDeviceList;
//Try to Open searching by ID and ItemName
rWIA.SelectDeviceItem(DeviceID, DeviceItemName, curSource, aIndex);
if (curSource = nil)
then begin
//Device not finded, search with DeviceName/DeviceManufacturer
aIndex:= rWia.FindDevice(DeviceName, DeviceManufacturer);
if (aIndex >= 0) then
begin
//Device found, try to connect
curSource:= rWia.Devices[aIndex];
if (curSource <> nil)
then begin
//Device connected, search for Item
if curSource.SelectItem(DeviceItemName)
then aIndex:= curSource.SelectedItemIndex
else begin
//Item not founded, ask the user what to do
aIndex:= -1;
curItem:= curSource.Items[0];
if (curItem <> nil) then
Case MessageDlg('DigIt WIA',
Format(rsWIADevItemSel, [DeviceName, DeviceManufacturer, DeviceItemName, curItem^.Name]),
mtConfirmation, [mbYes, mbRetry, mbAbort], 0) of
mrYes: begin curSource.SelectedItemIndex:= 0; aIndex:= curSource.SelectedItemIndex; end;
mrAbort: break;
end;
end;
end
else begin
//We have some Error connecting Device ask the user what to do
aIndex:= -1;
if (MessageDlg('DigIt WIA', rsWIAExcConnect+#13#10+DeviceName+#13#10+DeviceManufacturer,
mtError, [mbRetry, mbAbort], 0)=mrAbort)
then break;
end;
end
else if (MessageDlg('DigIt WIA', rsWIAExcNotFound+#13#10+DeviceName+#13#10+DeviceManufacturer,
mtError, [mbRetry, mbAbort], 0)=mrAbort)
then break;
end
else begin
//Device found and to connect
if (aIndex = -1) then
begin
//We have finded the Device but not the Item, ask the user what to do
curItem:= curSource.Items[0];
if (curItem <> nil) then
Case MessageDlg('DigIt WIA',
Format(rsWIADevItemSel, [DeviceName, DeviceManufacturer, DeviceItemName, curItem^.Name]),
mtConfirmation, [mbYes, mbRetry, mbAbort], 0) of
mrYes: begin curSource.SelectedItemIndex:= 0; aIndex:= curSource.SelectedItemIndex; end;
mrAbort: break;
end;
end;
end;
until (aIndex > -1);
if (aIndex = -1)
then Result:= GetFromUser //User has selected Abort, Get Another Device from List
else SelectSourceItem(curSource, aIndex);
finally
end;
end;
function TDigIt_Source_WIA.Duplicate: IDigIt_Params; stdcall;
begin
Result:= nil;
end;
function TDigIt_Source_WIA.Load(const xml_File: PChar; const xml_RootPath: PChar): Boolean; stdcall;
var
XMLWork: TXMLConfig;
i,
iCount: Integer;
curPath,
curItemPath: String;
begin
try
Result:= False;
XMLWork:= TXMLConfig.Create(xml_File);
DeviceID:= XMLWork.GetValue(xml_RootPath+'/ID', '');
DeviceItemName:= XMLWork.GetValue(xml_RootPath+'/Item', '');
DeviceManufacturer:= XMLWork.GetValue(xml_RootPath+'/Manufacturer', '');
DeviceName:= XMLWork.GetValue(xml_RootPath+'/ProductName', '');
countTakes:= XMLWork.GetValue(xml_RootPath+'/CountTakes', 0);
curPath:= xml_RootPath+'/WIAParams/';
iCount:= XMLWork.GetValue(curPath+'Count', 0);
WIAParams:= nil; //Avoid possible data overlaps by eliminating any existing array
SetLength(WIAParams, iCount);
for i:=0 to iCount-1 do
with (WIAParams[i]) do
begin
curItemPath :=curPath+'Item' + IntToStr(i)+'/';
//Set Default Values
PaperType:= wptMAX;
Rotation:= wrPortrait;
HAlign:= waHLeft;
VAlign:= waVTop;
DataType:= wdtCOLOR;
DocHandling:= [];
NativeUI:= XMLWork.GetValue(curItemPath+'NativeUI', False);
XMLWork.GetValue(curItemPath+'PaperType', PaperType, TypeInfo(TWIAPaperType));
PaperW:= XMLWork.GetValue(curItemPath+'PaperW', 0);
PaperH:= XMLWork.GetValue(curItemPath+'PaperH', 0);
XMLWork.GetValue(curItemPath+'Rotation', Rotation, TypeInfo(TWIARotation));
XMLWork.GetValue(curItemPath+'HAlign', HAlign, TypeInfo(TWIAAlignHorizontal));
XMLWork.GetValue(curItemPath+'VAlign', VAlign, TypeInfo(TWIAAlignVertical));
Resolution:= XMLWork.GetValue(curItemPath+'Resolution', 100);
Contrast:= XMLWork.GetValue(curItemPath+'Contrast', 0);
Brightness:= XMLWork.GetValue(curItemPath+'Brightness', 0);
XMLWork.GetValue(curItemPath+'DataType', DataType, TypeInfo(TWIADataType));
XMLWork.GetValue(curItemPath+'DocHandling', DocHandling, TypeInfo(TWIADocumentHandlingSet));
end;
Result:= True;
finally
XMLWork.Free;
end;
end;
function TDigIt_Source_WIA.Save(const xml_File: PChar; const xml_RootPath: PChar): Boolean; stdcall;
var
XMLWork: TXMLConfig;
i: Integer;
curPath,
curItemPath: String;
begin
try
Result:= False;
XMLWork:= TXMLConfig.Create(xml_File);
XMLWork.SetValue(xml_RootPath+'/ID', DeviceID);
XMLWork.SetValue(xml_RootPath+'/Item', DeviceItemName);
XMLWork.SetValue(xml_RootPath+'/Manufacturer', DeviceManufacturer);
XMLWork.SetValue(xml_RootPath+'/ProductName', DeviceName);
XMLWork.SetValue(xml_RootPath+'/CountTakes', countTakes);
curPath:= xml_RootPath+'/WIAParams/';
XMLWork.DeletePath(curPath);
XMLWork.SetValue(curPath+'Count', Length(WIAParams));
for i:=0 to Length(WIAParams)-1 do
with (WIAParams[i]) do
begin
curItemPath :=curPath+'Item' + IntToStr(i)+'/';
XMLWork.SetValue(curItemPath+'NativeUI', NativeUI);
XMLWork.SetValue(curItemPath+'PaperType', PaperType, TypeInfo(TWIAPaperType));
XMLWork.SetValue(curItemPath+'PaperW', PaperW);
XMLWork.SetValue(curItemPath+'PaperH', PaperH);
XMLWork.SetValue(curItemPath+'Rotation', Rotation, TypeInfo(TWIARotation));
XMLWork.SetValue(curItemPath+'HAlign', HAlign, TypeInfo(TWIAAlignHorizontal));
XMLWork.SetValue(curItemPath+'VAlign', VAlign, TypeInfo(TWIAAlignVertical));
XMLWork.SetValue(curItemPath+'Resolution', Resolution);
XMLWork.SetValue(curItemPath+'Contrast', Contrast);
XMLWork.SetValue(curItemPath+'Brightness', Brightness);
XMLWork.SetValue(curItemPath+'DataType', DataType, TypeInfo(TWIADataType));
XMLWork.SetValue(curItemPath+'DocHandling', DocHandling, TypeInfo(TWIADocumentHandlingSet));
end;
XMLWork.Flush;
Result:= True;
finally
XMLWork.Free;
end;
end;
function TDigIt_Source_WIA.Summary(const ASummary: PChar): Integer; stdcall;
begin
Result:= 0;
end;
function TDigIt_Source_WIA.Flags: TDigItInterfaceKind; stdcall;
begin
Result:= diSourceStd;
end;
function TDigIt_Source_WIA.Init: Boolean; stdcall;
begin
Result:= True;
end;
function TDigIt_Source_WIA.Enabled: Boolean; stdcall;
begin
Result:= rEnabled and (getWIA <> nil) and (rWIA.DevMgrIntf <> nil);
end;
function TDigIt_Source_WIA.setEnabled(AEnabled: Boolean): Boolean; stdcall;
begin
rEnabled:= AEnabled;
Result:= rEnabled;
end;
function TDigIt_Source_WIA.Release: Boolean; stdcall;
begin
Free;
Result:= True;
end;
function TDigIt_Source_WIA.Params: IDigIt_Params; stdcall;
begin
Result:= Self;
end;
function TDigIt_Source_WIA.UI_Title(out AUI_Title: PChar): Integer; stdcall;
begin
AUI_Title:= StrNew(PChar(rsWIAName));
Result:= Length(AUI_Title);
end;
function TDigIt_Source_WIA.UI_ImageIndex: Integer; stdcall;
begin
Result:= 5;
end;
function TDigIt_Source_WIA.Take(takeAction: DigIt_Source_TakeAction; out aDataType: TDigItDataType; out aData: Pointer): DWord; stdcall;
var
aExt,
curPath: String;
aFormat: TWIAImageFormat;
capRet: Boolean;
curParams: TWIAParams;
begin
try
Result:= 0;
aData:= nil;
aDataType:= diDataType_FileName;
//TFormAnimAcquiring.Execute; Application.ProcessMessages;
DownloadedFiles:= nil;
inc(countTakes);
curPath:= WIAPath_Temp+IntToStr(countTakes)+DirectorySeparator;
if WIAParams[DeviceItemIndex].NativeUI
then begin
Result:= rWiaSource.DownloadNativeUI(Application.ActiveFormHandle, False,
curPath, WIA_TakeFileName, DownloadedFiles);
end
else begin
UserCancel:= False;
curParams:= WIAParams[DeviceItemIndex];
if (takeAction = takeActPreview)
then begin
//Take only 1 page
{ #todo 10 -oMaxM : When switching from pages=1 to pages=all my Brother scanner returns an image
shrunk by a factor N within the correct sized page.
N= (Resolution when pages=0) / (Resolution when pages=1). I'm stumped. }
// capRet:= rWIASource.SetPages(1); //ignore Result
//Set minimum Resolution
curParams.Resolution:= ResMin;
end
else capRet:= rWIASource.SetPages(0); //all Pages
Progress:= theBridge.Progress;
if (Progress <> nil) then
begin
Progress.SetTotalLabel(PChar(Format(rsWIAAcquiringTotal, [DeviceItemName, curParams.Resolution])));
Progress.SetTotal(0, 100, 0, True);
Progress.SetCurrentCaption(nil);
Progress.SetCurrent(0, 100, 0, False);
Progress.SetEventCallBack(Self as IDigIt_ProgressCallback);
Progress.Show(PChar(Format(rsWIAAcquiringTitle, [DeviceName])));
end;
rWIASource.SetParams(curParams);
{ #todo 5 -oMaxM : Move To Download? }
if WIAParams[DeviceItemIndex].DataType in [wdtRAW_RGB..wdtRAW_CMYK]
then capRet:= rWIASource.SetImageFormat(wifRAW)
else capRet:= rWIASource.SetImageFormat(wifBMP);
//if not(capRet) then raise Exception.Create('SetImageFormat');
if WIAParams[DeviceItemIndex].DataType in [wdtRAW_RGB..wdtRAW_CMYK]
then begin
aFormat:= wifRAW;
aExt:= '.raw'
end
else begin
aFormat:= wifBMP;
aExt:= '.bmp';
end;
Result:= rWIASource.Download(curPath, WIA_TakeFileName, aExt,
aFormat, DownloadedFiles);
end;
if (Result > 0)
then if (Result = 1 )
then aData:= StrNew(PChar(DownloadedFiles[0]))
else aData:= Self as IDigIt_ROArray
else begin
DeleteDirectory(curPath, False);
dec(countTakes);
end;
Application.BringToFront;
finally
if (Progress <> nil) then Progress.Hide;
end;
end;
procedure TDigIt_Source_WIA.Clear; stdcall;
var
i: Integer;
begin
{$ifopt D-}
for i:=0 to countTakes do
DeleteDirectory(WIAPath_Temp+IntToStr(i)+DirectorySeparator, False);
{$endif}
countTakes:= -1;
DownloadedFiles:= nil;
end;
function TDigIt_Source_WIA.GetCount: DWord; stdcall;
begin
Result:= Length(DownloadedFiles);
end;
function TDigIt_Source_WIA.Get(const aIndex: DWord; out aData: Pointer): Boolean; stdcall;
begin
Result:= (aIndex < Length(DownloadedFiles));
if Result
then aData:= StrNew(PChar(DownloadedFiles[aIndex]))
else aData:= nil;
end;
procedure TDigIt_Source_WIA.ProgressCancelClick(ATotalValue, ACurrentValue: Integer); stdcall;
begin
UserCancel:= True;
end;
initialization
try
WIAPath_Temp:= theBridge.Settings.Path_Temp+'wia'+DirectorySeparator;
Source_WIA:= TDigIt_Source_WIA.Create;
theBridge.Sources.Register(DigIt_Source_WIA_Name, Source_WIA);
except
end;
end.