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
Save Password
Forgot your Password?

 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
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  


Czech Republic
3 Posts

Posted - Apr 07 2024 :  15:59:24  Show Profile  Reply
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


38231 Posts

Posted - Apr 07 2024 :  19:41:39  Show Profile  Reply
Hi Martin

You have two main options:

1. Add a rectangular shape layer object:

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

Or manually in a mouse event using LayersAdd();

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

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

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

Xequte Software
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: