 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Pablo Arthur Rodger Guest
|
Posted: Tue Sep 20, 2005 3:42 pm Post subject: Olevariant and WIA |
|
|
I am trying to use the scanner. I get the scanner to transfer the image to
an olevariant
but I have the same problem that you. I can not cast the variable into the
imagefile variable.
I believe this is very easy, but I can not make it work.
I will apreciate your help, whenever you can
Thanks in advance,
var
dev : IDevice;
itm : IItem;
iimg : IImageFile;
x : OleVariant;
Vector : IVector;
PropDisp : Integer;
begin
dev := WIAComDialog1.ShowSelectDevice(ScannerDeviceType,false,true); //
true false, etc.
If dev.type_ = ScannerDeviceType then
begin
// ShowMessage(dev.DeviceID);
for PropDisp := 1 to Dev.Items.Count do
begin
itm :=
dev.ExecuteCommand('{9B26B7B2-ACAD-11D2-A093-00C04F72DC3C}'); // Synchronize
itm := Dev.Items.Item[1];
iimg := itm.Transfer('{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}');
// THIS GIVES AN ERROR OF INCOMPATIBLE TYPES "OLEVARIANT AND IIMAGEFILE
x := itm.Transfer('{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}');
// THIS WORKS OK. BUT I CAN NOT CAST THE OLEVARIANT INTO THE IIMAGE FILE
iimg.SaveFile('kk.tif');
end;
end;
end;
I saw your example later on where it works but I do not see the declaration
of the
TheFile variable // What type of variable this is?
TheFile :=
itm.Transfer('{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}');
TheFile.SaveFile('C:file.tif');
Can you send me the part of this code,
Pablo Arthur-Rodger
Dominican Republic
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|