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
 DPI of scanner changes when saving to file
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pssien

10 Posts

Posted - Oct 02 2015 :  06:26:29  Show Profile  Reply
This is a fragment of the coda that I am using for scanning a color document at 100 DPI.
After scanning the image, if I look at Params[0].DpiY property, it continues to be 100 DPI, but the saved image, it has 300 DPI.
Why IESaveToFile does not follow the properties of the original image, or in another way, how can I adjust the image to 100 DPI before saving.


  // Scanner params
  ImageEnMView1.MIO.TwainParams.YResolution.CurrentValue := 100;
  ImageEnMView1.MIO.TwainParams.XResolution.CurrentValue := 100;
  gbStat := ImageEnMView1.MIO.Acquire

  // Thumbnail of the scanned document
  ImageEnMView1.CopyToIEBitmap(0, ImageEnView1.IEBitmap);
  ImageEnView1.AutoFit := True;
  ImageEnView1.Fit;
  ImageEnMView1.ScrollBars := ssNone;
  ImageEnView1.Update;

  // Save to file
  ImageEnMView1.SelectedImage := 0;
  iIEBitmap := ImageEnMView1.GetTIEBitmap(0);
  iIEBitmap.IESaveToFile('C:\TEST.JPG', 90);

xequte

39061 Posts

Posted - Oct 02 2015 :  15:55:57  Show Profile  Reply
Hi

An image has both its content (bitmap) and its image properties (params). You have filled your IEBitmap with the content, but not the params, so when you call iIEBitmap.IESaveToFile() it is saving with the default params.


Either retrieve the params as well, or use a method that includes the params:

http://www.imageen.com/help/TImageEnMView.GetImageToFile.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

pssien

10 Posts

Posted - Oct 05 2015 :  03:58:19  Show Profile  Reply
Thanks for your explanation, now it is working as expected.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: