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
 TImageEnView "Crop to Fit" option
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

HeartWare

Denmark
46 Posts

Posted - Jul 03 2021 :  02:22:29  Show Profile  Reply
Is it possible to get an TImageEnView (v10.0) to do a "Crop to Fit" of a loaded image when displaying it? Ie., it should zoom the picture to a scale factor so that the image fills the entire size of the TImageEnView, possibly with some part of the image (as little as possible) being cropped off.

xequte

38176 Posts

Posted - Jul 03 2021 :  18:24:35  Show Profile  Reply
Hi

Do you mean like the following?

// Zoom to fill control by cropping image view (while maintaining the aspect ratio)
ImageEnView.GetIdealZoom( ZoomX, ZoomY );
ImageEnView.Zoom := dmax( ZoomX, ZoomY );


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

HeartWare

Denmark
46 Posts

Posted - Jul 04 2021 :  10:14:51  Show Profile  Reply
Yes, that code works. Except when you then re-size the form (which leads to a re-size of the TImageEnView). In that case, the Crop should carry along, just like the AutoFit does. How about an AutoCrop option?

And remember to disable AutoFit when you set AutoCrop (and vice versa) and to refresh the displayed data in the TImageEnView.
Go to Top of Page

xequte

38176 Posts

Posted - Jul 09 2021 :  02:13:13  Show Profile  Reply
Hi

We'll have this in the next release as TImageEnView.FitCropping. You can email me to test it.

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