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
 Select or Crop tool for user interaction
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AdrianKnowles

USA
35 Posts

Posted - Sep 06 2023 :  10:17:10  Show Profile  Reply
Hi there,
I've a small project where I'm considering using select tool or the crop tool. The user has to simply move/resize the rectangle on an image. There are certain criteria on how they interact.

The criteria are

A rectangle is displayed on the image (generated by crop or select tool I'm thinking)
The user can interact with the rectangle via 4 grab handles at the corners
The user can move the rectangle up or down but not left to right
The user can alter the rectangle height but not the width
The user cannot rotate the rectangle.

Playing with crop tool then
- I dont see a way to limit the movement of the rectangle.
- I can lock width.
- I dont see how to disallow rotation.
- Using ImageEnView1.SetSelectionGripStyle(clPurple, clwhite,bsSolid, 16,false, iegsCircle); then
using miSelect the grip handle in the middle of the lines are not drawn, expected behavior
In miCrop they are drawn (regardless of if TRUE or FALSE),



Any insights appreciated.
Thanks,
Adrian

xequte

38610 Posts

Posted - Sep 07 2023 :  02:31:33  Show Profile  Reply
Hi Adrian

With regard to your queries:

- I dont see a way to limit the movement of the rectangle

There is not a good way to do this other than to fudge the CropTool.BitmapPolygon in the MouseMove event.

https://www.imageen.com/help/TIECropToolInteraction.BitmapPolygon.html


- I dont see how to disallow rotation

ImageEnView1.CropTool.Options := ImageEnView1.CropTool.Options - [ iecoAllowRotating ];

https://www.imageen.com/help/TIECropToolInteraction.Options.html


- The grip handle in the middle of the lines are not drawn

Email me for the latest beta that fixes this


But given the extent of the styling and manipulation changes you are looking at (the ones you emailed me about), I would be tempted just to create my own TIEUserInteraction.

https://www.imageen.com/help/TIEUserInteraction.html

It can be complex, but it gives you much more access to the internal functioning of ImageEnView.

Here is an example:
attach/xequte/20239723121_CustomUserInteraction.zip
23.6 KB

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

xequte

38610 Posts

Posted - Sep 07 2023 :  19:34:56  Show Profile  Reply
Hi Adrian

If you are just looking to create a display prototype (without long-term maintenance concerns) then another option would be to copy the entire TIECropToolInteraction class to a local unit, rename the class and then add it to TImageEnView.UserInteractions:

fMyCropToolInteraction := TMyCropToolInteraction.Create(ImageEnView1);
ImageEnView1.UserInteractions.Add( fMyCropToolInteraction );
fMyCropToolInteraction.Enabled := true;

That way you could manipulate the functionality and styling of the crop UI as much as you need.

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