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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 MIO.Acquire resolution always 300 dpi

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
aleatprog Posted - Jun 23 2023 : 05:15:01
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
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 03 2023 : 00:17:32
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
aleatprog Posted - Jun 24 2023 : 07:54:43
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

xequte Posted - Jun 24 2023 : 02:12:14
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