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
 Create rectangle with fixed size and with centre in the mouse click location

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
MartinR Posted - Apr 07 2024 : 15:59:24
Hello,
I have to use this excellent library for a simple app to label parts of images.

There are some basic requirements. When the user clicks the mouse, a rectangle (vector) should be created with its centre exactly at the point of the click. Is it possible to do this by just adjusting some parameters or do I have to manually add or draw the rectangle object on the background image within the code's onMouseClick event?

Thank you very much for the hint and the help.

Best regards
Martin
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 07 2024 : 19:41:39
Hi Martin

You have two main options:

1. Add a rectangular shape layer object:

http://www.imageen.com/help/TIEShapeLayer.html

You can either add this automatically (click and drag) using mlCreateShapeLayers:

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

Or manually in a mouse event using LayersAdd();

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

Of course, you would need to merge (burn it) with the image when you are done:

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


2. Draw directly to the bitmap's TIECanvas, e.g.

http://www.imageen.com/help/TIECanvas.Rectangle.html
http://www.imageen.com/help/TIECanvas.AdvancedDrawShape.html

Ensure you call ImageEnView1.Update() to display the canvas changes in the viewer.


Nigel
Xequte Software
www.imageen.com