ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Select or Crop tool for user interaction

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AdrianKnowles Posted - Sep 06 2023 : 10:17:10
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
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 07 2023 : 19:34:56
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
xequte Posted - Sep 07 2023 : 02:31:33
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