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
 How to redimention a documento in inches?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jccruz

Brazil
30 Posts

Posted - Nov 27 2018 :  04:33:26  Show Profile  Reply
Hello!

I need to scan a document using a smartphone (mobile).
I am using the App Office Lens with 13.0MP (4160px x 3120px).
After scan, when I check the saved file (JPG), its properties are:

Width: 30.75in x Height: 45.70in
Width: 2952px x Height: 4394px
96 DPI
24bits

I need to redimension the document size to exact W: 8.5" x H: 11.7" keeping the aspect radio.

I too need to change the bit depth from 24bits to 8bits.

How can I do these two operation using Imageen?

Thanks everybody!

Jose Carlos

JCC

xequte

38616 Posts

Posted - Nov 27 2018 :  22:29:27  Show Profile  Reply
Hi Jose

> I need to redimension the document size to exact W: 8.5" x H: 11.7"

The formulas for DPI are as follows:

dpiX := widthPixels div widthInches;
dpiY := heightPixels div heightInches;

widthPixels := widthInches * dpiX ;
heightPixels := heightInches * dpiY;

widthInches := widthPixels div dpiX ;
heightInches := heightPixels div dpiY;

// Set image dimensions to 8.5 x 11.7" 
ImageEnView1.IO.Params.DpiX := Round( ImageEnView1.IO.Params.Width / 8.5 );
ImageEnView1.IO.Params.DpiY := Round( ImageEnView1.IO.Params.Height / 11.7 );



> I too need to change the bit depth from 24bits to 8bits.


// Set pixel format to 8bit gray-scale
ImageEnView1.IEBitmap.PixelFormat := ie8g;
ImageEnView1.Update();


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