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
 Polygon Selection with TImageEnView

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
HMArnold Posted - Sep 30 2025 : 20:57:15
I'm trying to learn how to select and deselect polygons using TImageEnView

Using this code...

Image.IO.LoadFromFileJpeg('Test.jpg');
SetLength (NodeArry, 4);

NodeArry[0].X := 510; NodeArry[0].Y := 175;
NodeArry[1].X := 570; NodeArry[1].Y := 175;
NodeArry[2].X := 570; NodeArry[2].Y := 270;
NodeArry[3].X := 510; NodeArry[3].Y := 270;
Image.LayersAdd (NodeArry,True,clRed,2,clBlue);
Image.CurrentLayer.Transparency := 75;
Image.CurrentLayer.Tag := 55;

NodeArry[0].X := 485; NodeArry[0].Y := 870;
NodeArry[1].X := 538; NodeArry[1].Y := 870;
NodeArry[2].X := 538; NodeArry[2].Y := 965;
NodeArry[3].X := 485; NodeArry[3].Y := 965;
Image.LayersAdd (NodeArry,True,clRed,2,clBlue);
Image.CurrentLayer.Transparency := 75;
Image.CurrentLayer.Tag := 56;

Image.LayersDeselectAll;

Image.LayersSelectAll(true);

Image.Update;

Both polygons display fine, with the last polygon defined is always selected.

Deselect and SelectAll don't seem to have any effect.

I also don't see a way to select a specific polygon given it's index, handle, or tag

Is there a demo that shows this? If so, I haven't been able to find it

Thanks in advance


HM Arnold
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 02 2025 : 01:23:15
Hi

You can get the size and position of the layer using ImageEnView1.Layers[...].PosX/PosY/Width/Height (in terms of bitmap pixels).

You can then use that to add a text layer using the position the overload:

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

Or just add the layer then set ImageEnView1.CurrentLayer.PosX/PosY/Width/Height.

See the example at:

http://www.imageen.com/help/TIELayer.PosX.html


Nigel
Xequte Software
www.imageen.com
xequte Posted - Oct 02 2025 : 01:19:29
Hi

You can just make the a layer active and selected using LayersCurrent:

ImageEnView1.LayersCurrent := 1;

In a multi-selection scenario, you can use:

http://www.imageen.com/help/TImageEnView.LayersSelectedList.html
or
http://www.imageen.com/help/TImageEnView.Selected.html

Nigel
Xequte Software
www.imageen.com
HMArnold Posted - Oct 01 2025 : 10:45:59
Also, what is the new TImageEnView way to add a text label at a pixel X/Y location?

In this case I already have a layer for the polygon.

I assume it is a new layer for each label, but then how do I locate it to a pixel coordinate near the polygon?

I can't find a Demo or Help section that describes setting the text location

HM Arnold