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 get ImageEn to output image in exact DPI
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Dec 08 2015 :  23:43:18  Show Profile  Reply
Hello,

In our software we allow users to load multiple images. Each image is on a separate layer.

We save such files as layer files.

Till there things work just great.

But when we Merge all Layers and try to save the file in JPG we want the final output file to be of 200 DPI. Tried everything that I know about ImageEn to cannot get expected result.

Setting parameters is not getting expected result...
For example I am setting following with hope to get expected DPI output in the final JPG file saved:

ImageEnViewMain.DpiX := 200
ImageEnViewMain.DpiY := 200;
ImageEnViewMain.IO.Params.JPEG_Quality := 100;
ImageEnViewMain.IO.Params.JPEG_Smooth := 3;
ImageEnViewMain.IO.Params.JPEG_Progressive := False;
ImageEnViewMain.IO.Params.JPEG_ColorSpace := ioJPEG_RGB;

ImageEnViewMain.IO.SaveToFileJpeg(FlName);


The above code does not yield expected result.

Please help me.

TIA


Yogi Yang

w2m

USA
1990 Posts

Posted - Dec 09 2015 :  08:06:36  Show Profile  Reply
Hi Yogi,

Try SetDPI...

Declaration
procedure SetDPI(dpiX, dpiY: integer);

Description
The SetDPI method sets the horizontal (DpiX) and vertical (DpiY) dots per inch of the current image. These values will be saved together with the image.
ImageEnViewMain.SetDPI(200, 200)

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

38947 Posts

Posted - Dec 09 2015 :  21:15:35  Show Profile  Reply
Hi Yogi

In what way does it not "yield the expected result"?


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

yogiyang

India
727 Posts

Posted - Dec 09 2015 :  22:23:18  Show Profile  Reply
Hi Bill,

Thanks for the tip.



Yogi Yang
Go to Top of Page

yogiyang

India
727 Posts

Posted - Dec 09 2015 :  22:26:56  Show Profile  Reply
Hello Nigel,

When ImageEn saves a JPG file using the code I have posted in my first post it saves it in 300 DPI. Not only that it also shrinks the width and height of the image.

I confirmed this using Irfan View as well as Photoshop.

What I want to achieve is set the file DPI to 200.

TIA


Yogi Yang
Go to Top of Page

xequte

38947 Posts

Posted - Dec 10 2015 :  14:12:55  Show Profile  Reply
Hi Yogi

You need to be setting the image params, not the display DPI:

ImageEnView1.IO.Params.DpiX := 200;
ImageEnView1.IO.Params.DpiY := 200;


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