| Author |
Topic  |
|
|
HMArnold
 
USA
33 Posts |
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 |
|
|
HMArnold
 
USA
33 Posts |
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 |
 |
|
|
xequte
    
39279 Posts |
|
|
xequte
    
39279 Posts |
|
| |
Topic  |
|
|
|