ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 MIO.Acquire resolution always 300 dpi
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

132 Posts

Posted - Jun 23 2023 :  05:15:01  Show Profile  Reply
Hi,

even if I specify 200 dpi as scan resolution inside the WIA scanner interface, the acquired image got 300 dpi.

I used the following code:

procedure TForm23.Button2Click(Sender: TObject);
begin
  if ImageEnMView1.MIO.SelectAcquireSource([ieaTwain, ieaWIA, ieaDCIM]) then
    ImageEnMView1.MIO.Acquire(True);
end;

procedure TForm23.iemViewAcquireBitmap(Sender: TObject; ABitmap: TIEBitmap;
  DpiX, DpiY: Integer; var Handled: Boolean);
begin
  ABitmap.Write('c:\...\test.jpg');
  Handled := True;
end;


Also setting a resolution of 200 dpi by code generates a 300 dpi image:

procedure TForm23.Button2Click(Sender: TObject);
begin
  if ImageEnMView1.MIO.SelectAcquireSource([ieaTwain, ieaWIA, ieaDCIM]) then
    begin
      ImageEnMView1.MIO.AcquireParams.XResolution := 200;
      ImageEnMView1.MIO.AcquireParams.YResolution := 200;
      ImageEnMView1.MIO.Acquire(True);
    end;
end;

procedure TForm23.iemViewAcquireBitmap(Sender: TObject; ABitmap: TIEBitmap;
  DpiX, DpiY: Integer; var Handled: Boolean);
begin
  ABitmap.Write('c:\...\test.jpg');
  Handled := True;
end;


Any ideas?

PS: Please correct the "TImageEnMIO.Acquire" entry in the manual. Instead of the current text:
"If AppendAtEnd = False, and an image is selected, then new images will be inserted after the current selection. Otherwise, they are appended after the last image"
it should be:
"If AppendAtEnd = False, and an image is selected, then new images will be inserted before the current selection. Otherwise, they are appended after the last image".

Thank you,
Ale

xequte

38531 Posts

Posted - Jun 24 2023 :  02:12:14  Show Profile  Reply
Thanks Ale

I will correct the documentation.

I'm not sure about the dpi issue. Are you sure you are setting a DPI that is supported by the scanner? Have you tried acquiring via Twain to see if you get a different result?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

aleatprog

132 Posts

Posted - Jun 24 2023 :  07:54:43  Show Profile  Reply
Hi Nigel,

I confirm that the scanner supports 200 dpi. In my first example, in fact, I used the scanner's WIA driver interface to set 200 dpi. Furthermore, using the app "Fax & Scanner for Windows" the scanned page got 200 dpi.

Ale

Go to Top of Page

xequte

38531 Posts

Posted - Jul 03 2023 :  00:17:32  Show Profile  Reply
Hi

I can't see any reason that should be occurring.

In the code setting X/YResolution is correctly applied to the WIA properties WIA_IPS_XRES and WIA_IPS_YRES.

You might want to try working directly with WIA interface:

http://www.imageen.com/help/TImageEnIO.WIAParams.html

http://www.imageen.com/help/TIEWia.SetItemProperty.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: