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
 How to prevent drawing a layer outside of the loaded image

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
Flashcqxg Posted - Jul 24 2023 : 06:13:30
I have allow users to draw a rectangular area, and the code is as follows. I want to achieve the following two points:
1. If the image is not loaded, users cannot use the mouse to draw layers;
2. After loading the image, the user can only draw a rectangular area layer within the size range of the image, and during the drawing process, the mouse cannot exceed the size range of the image.
Thanks.


ImgeEnView.MouseInteractLayers := [mlCreateShapeLayers];
IEGlobalSettings().DefaultLayerShape := iesRectangle;
4   L A T E S T    R E P L I E S    (Newest First)
Flashcqxg Posted - Jul 25 2023 : 01:54:23
Thanks.
xequte Posted - Jul 25 2023 : 00:48:28
Hi

Avoid applying MouseInteractLayers := [mlCreateShapeLayers]; until after image loading, e.g. by checking IsEmpty in the OnImageChange event:

http://www.imageen.com/help/TImageEnView.IsEmpty.html

Nigel
Xequte Software
www.imageen.com
Flashcqxg Posted - Jul 24 2023 : 18:48:05
Thank you, the second issue has been resolved. But if there is no image loaded, it is also necessary to disable mouse drag. Can this be achieved?
xequte Posted - Jul 24 2023 : 18:16:00
Please see loPreventOutOfBounds for TImageEnView.LayerOptions:

https://www.imageen.com/help/TImageEnView.LayerOptions.html

Nigel
Xequte Software
www.imageen.com