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
 disable rotation and fixed aspect ratio
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

johnbitner

USA
4 Posts

Posted - Feb 24 2017 :  09:14:23  Show Profile  Reply
1. Can you disable the rotate features of the CropToolInteraction? I want to allow crop but not rotate in my tools.
2. I set the following in my code but I can still can resize the crop area from the sides and get a ratio that is not 1/1.


  imgview.CropToolInteraction.LockAspectRatio:= 1;
  imgview.SelectionAspectRatio:= 1 / 1;
  imgview.CropToolInteraction.Options:= [iecoSideGripsRespectLocks];
  imgview.CropToolInteraction.DrawGuides := True;
  imgview.CropToolInteraction.AntialiasMode := ierBicubic;
  imgview.CropToolInteraction.GripSize := 12;
  imgview.MouseInteract := [miCropTool];


See in the capture below the crop area is not 1/1.



John B

w2m

USA
1990 Posts

Posted - Feb 24 2017 :  09:46:43  Show Profile  Reply
ImageEnView.CropToolInteraction.LockAspectRatio:= 1;
ImageEnView.SelectionAspectRatio:= 1;
ImageEnView.CropToolInteraction.Options:= [iecoSideGripsRespectLocks];
ImageEnView.CropToolInteraction.DrawGuides := True;
ImageEnView.CropToolInteraction.AntialiasMode := ierBicubic;
ImageEnView.CropToolInteraction.GripSize := 12;
ImageEnView.MouseInteract := [miCropTool];
ImageEnView.DisplayGridKind := iedgNone;

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

johnbitner

USA
4 Posts

Posted - Feb 24 2017 :  12:35:56  Show Profile  Reply
Hello, thanks for the example. Made the changes in my code. Still can rotate the image and skew the crop area. I made a small project with just the TImageEnView control, the code above to setup the crop tool, and a method to load an image. I can still can rotate the crop area and skew the area when I drag the side grips. Attached is the simple project and an image.



attach/johnbitner/2017224123432_imagedemo.zip
6.77 KB

John B
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 24 2017 :  13:54:45  Show Profile  Reply
In my testing, the crop tool was proportional 1:1 ie. width = 300 height = 300 and resized proportionally at 1:1 with my code. However, I do not think there is a way to prevent rotation in the current version.

Your demo does the same thing as my test.
 
I can still can rotate the crop area and skew the area when I drag the side grips.

This is not true even with your demo. You can rotate but you can not skew the selection so it is no longer proportional. There is no apparent way to prevent rotation in the current version.

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

johnbitner

USA
4 Posts

Posted - Feb 24 2017 :  15:29:53  Show Profile  Reply
If I drag from the corners the skewing doesn't occur. That is true. If I drag from the side grips I get what you see in the screenshot. Once you get small enough the proportion isn't 1/1.

I posted a video in the zip that shows the skew when you resize from the side grip.

Thanks for your help.

attach/johnbitner/201722415290_cropissue.zip
896.29 KB

John B
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 24 2017 :  15:48:39  Show Profile  Reply
Hmmm. I guess you are correct, but only when a non-corner grip is used. The proportionality remains until the dimensions of the selection are less or equal to the state of the dimensions when the croptool is created. I do not see this when using the corner grips.

Maybe Nigel should take a look at this.

Also it would be "nice" to add iecoNoRotation option to achieve your needs and to be able to set the dimensions of the crop dimensions when the crop tool is created. If you create the croptool and then click on the image before dragging, the crop tool appears but the dimensions are not proportional when ImageEnView.CropToolInteraction.LockAspectRatio:= 1; The proportionality only kicks in as you resize the selection or if you click on a corner grip.

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

38180 Posts

Posted - Feb 26 2017 :  18:14:39  Show Profile  Reply
Hi

These are the CropTool Options in v7.0.0:

iecoAllowResizing: The user can resize the crop selection by dragging the corner or side grips
iecoAllowRotating: The user can rotate the crop selection by dragging outside the corner grips
iecoAllowMoving: The user can move the crop selection by clicking within the selection area
iecoSideGripsRespectLocks: Determines whether the specified aspect ratio lock is enforced when dragging the side, top and bottom grips. If this option is not set then only the corner grips will respect the lock
iecoSizeLocksAreMinimums: If included, then the specified LockWidth or LockHeight are treated as minimum values, i.e. the user can make the selection larger than the specified values, but not smaller

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

johnbitner

USA
4 Posts

Posted - Feb 28 2017 :  09:51:12  Show Profile  Reply
Awesome guys! Thanks for the quick responses and new features! How soon with this build be ready to download?

John B
Go to Top of Page

xequte

38180 Posts

Posted - Mar 02 2017 :  15:00:21  Show Profile  Reply
Hi John

We're aiming for a release this month, but it depends on the length of the bug testing phase. But you can email for a pre-release.

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: