Hi,
I am currently using IE 15.4.0 beta and I have interesting problem. I set up scanner to scan whole area using 300 dpi but the image I get is with 150 dpi. Related to the topic "Scanner hold up after scanning", I am writing to a log and here is an exceprt:
06.11.2026 11:58:05 Device selected: CanoScan 9000F Mark II||0||WIA||SCN
06.11.2026 11:58:05 According to AcquireParams.SelectedSource.API it is WIA
06.11.2026 11:58:05 Scanning will be performed using WIA 1
06.11.2026 11:58:05 Requested scan in full color
06.11.2026 11:58:05 Writing params in MIO.AcquireParams
06.11.2026 11:58:05 Basic params: 300 dpi, color depth: Barvno (24-bit), orientation: Pokon#269;no, rotation: 0
06.11.2026 11:58:05 Writing params in MIO.AcquireParams.. done.
06.11.2026 11:58:05 Requesting scan start from a device (driver)
06.11.2026 11:58:05 scanning document, 62 ms 0%
06.11.2026 11:58:11 scanning document, 6343 ms 100%
06.11.2026 11:58:12 Scan complete - On AcquireBitmap, 6593 ms 100%, bitmap width: 1275, height: 1753, dpi X: 150, dpi Y: 150
The last line is from ImageEnMView.OnAcquireBitmap. Why the received image has 150dpi? There is even more fun to this. If I set scanner to 150 dpi or 200 dpi, the last line is the same; same bitmap size, same dpi.
Before scanning I set the params like this:
(setting the scanner in the extra window, result is index in TStringList named SeznamNapravRaw
sNapravaRaw := SeznamNapravRaw.Strings[AIndexNaprave];
iemvSlike.MIO.AcquireParams.SetSourceByStr(sNapravaRaw);
xDevice := StrToAcquireSource(sNapravaRaw);
if xDevice.API = ieaTwain then
begin
iemvSlike.MIO.TwainParams.GetFromScanner;
glScannerSkup.SkenerInfo.OpticalX := Round(iemvSlike.MIO.AcquireParams.AttachedTwainParams.XResolution.RangeMax);
glScannerSkup.SkenerInfo.OpticalY := Round(iemvSlike.MIO.AcquireParams.AttachedTwainParams.YResolution.RangeMax);
glScannerSkup.SkenerInfo.MaxSizeX := iemvSlike.MIO.AcquireParams.AttachedTwainParams.PhysicalWidth;
glScannerSkup.SkenerInfo.MaxSizeY := iemvSlike.MIO.AcquireParams.AttachedTwainParams.PhysicalHeight;
end;
if xDevice.API = ieaWIA then
begin
iTemp := 0;
sTemp := iemvSlike.MIO.WIAParams.GetDeviceProperty( WIA_DPS_OPTICAL_XRES );
TryStrToInt(sTemp, iTemp);
glScannerSkup.SkenerInfo.OpticalX := iTemp;
iTemp := 0;
sTemp := iemvSlike.MIO.WIAParams.GetDeviceProperty( WIA_DPS_OPTICAL_YRES );
TryStrToInt(sTemp, iTemp);
glScannerSkup.SkenerInfo.OpticalY := iTemp;
iTemp := 8500; //width of "letter" - full size scan
sTemp := iemvSlike.MIO.WIAParams.GetDeviceProperty( WIA_DPS_HORIZONTAL_BED_SIZE);
TryStrToInt(sTemp, iTemp);
glScannerSkup.SkenerInfo.MaxSizeX := iTemp/1000;
iTemp := 11690; //height of "letter" - full size scan
sTemp := iemvSlike.MIO.WIAParams.GetDeviceProperty( WIA_DPS_VERTICAL_BED_SIZE);
TryStrToInt(sTemp, iTemp);
glScannerSkup.SkenerInfo.MaxSizeY := iTemp/1000;
end;
..
with iemvSlike.MIO do //=imageenmview.mio
begin
AcquireParams.XScaling := 1;
AcquireParams.YScaling := 1;
AcquireParams.XResolution := glNastavitveXML.Nastavitve.Skener.Locljivost;
AcquireParams.YResolution := glNastavitveXML.Nastavitve.Skener.Locljivost;
iemvSlike.MIO.AcquireParams.AcquireFrameEnabled := True;
AcquireParams.AcquireFrameLeft := 0.0;
AcquireParams.AcquireFrameTop := 0.0;
AcquireParams.AcquireFrameRight := glScannerSkup.SkenerInfo.MaxSizeX;
AcquireParams.AcquireFrameBottom := glScannerSkup.SkenerInfo.MaxSizeY;
if AcquireParams.SelectedSourceApi = ieaTwain then
begin
NativePixelFormat := True;
end
else if AcquireParams.SelectedSourceApi = ieaWIA then
begin
//WIAParams.TransferFormat := ietfJpeg;
WIAParams.TransferFormat := ietfBitmap;
WiaParams.SetItemProperty(WIA_IPS_XRES, glNastavitveXML.Nastavitve.Skener.Locljivost);
WiaParams.SetItemProperty(WIA_IPS_YRES, glNastavitveXML.Nastavitve.Skener.Locljivost);
end;
AcquireParams.PixelType := TIEAcquirePixelType( glNastavitveXML.Nastavitve.Skener.BarvnaGlobina );
AcquireParams.Orientation := DobiOrientacijo;
AcquireParams.Rotation := DobiRotacijo;
for i := 0 to Length(Acquire_Source)-1 do
begin
if i = 1 then
xSrc := tsrcFeeder
else if i = 2 then
xSrc := tsrcDuplexer
else
xSrc := tsrcFlat;
if SameText(Acquire_Source[xSrc], glNastavitveXML.Nastavitve.Skener.VirDokumentov) then
begin
if (AcquireParams.FeederEnabled) and ( xSrc = tsrcFeeder) then
AcquireParams.AutoFeed := AcquireParams.FeederLoaded;
if (AcquireParams.DuplexSupported) and (xSrc = tsrcDuplexer) then
AcquireParams.DuplexEnabled := True;
Break;
end;
end;
AcquireParams.VisibleDialog := glNastavitveXML.Nastavitve.Skener.PokaziDialog;
...
iemvSlike.MIO.Acquire();
TWAIN works perfectly, the DPI is correct as well as the picture size, which for 300 dpi is 2550 x 3705 pixels. Any ideas?
Best regards,
Goran