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
 Image resolution resampling
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

HMArnold

USA
23 Posts

Posted - Apr 06 2014 :  14:40:27  Show Profile  Reply
I have a bunch of very high resolution wildlife images I want to re-size for a webpage, but I've never used ImageEn enough to know how to do it.

If I just LOADJPEG then SAVEJPEG, I get a significant reduction in file size, and the picture retains it's aspect and colors.

RESIZE crops and I can't tell that changing DPIX/DPIY affects the saved image at all.

Which image setting, procedure or demo shows how to downsample images?

Thanks

Hank

HM Arnold

w2m

USA
1990 Posts

Posted - Apr 06 2014 :  16:04:03  Show Profile  Reply
I think you want to resample the image:
ImageEnView1.Proc.Resample(iWidth, -1, rfNone);

or
ImageEnView1.Proc.Resample(iWidth, iHeight, rfNone, True)

This will reduce the dimensions of the image while maintaining the aspect ratio and will reduce the file size as well.

Declaration
procedure Resample(NewWidth, NewHeight: integer; FilterType: TResampleFilter = rfNone; bMaintainAspectRatio : Boolean = False);

Description
This method resizes the current image. The content of the image changes (stretched to new size).

Parameter Description
NewWidth New image width in pixels. If NewWidth is -1 then it is calculated automatically, respecting the proportions.
NewHeight New image height in pixels. If NewHeight is -1 then it is calculated automatically, respecting the proportions.
FilterType Resampling interpolation algorithm.
bMaintainAspectRatio Automatically reduces NewWidth or NewHeight to ensure the original proportions of the image are maintained

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development
Go to Top of Page

HMArnold

USA
23 Posts

Posted - Apr 07 2014 :  04:24:40  Show Profile  Reply
Thanks, William

That's exactly what I'm looking for.

HM Arnold
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: