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

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Annotation real time position
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Deeron

67 Posts

Posted - May 28 2021 :  11:36:45  Show Profile  Reply
Hi Nigel,

You wrote earlier that Left, Top properties of annotation returns the position of the upper left corner, but in real time how do I get it back and the Width, Height properties when I scale with the mouse. I didn't find any events.

Is it possible to get the position (possibly the size) of the annotation back in real time when I move it with the mouse (IEvolution .NET)?

xequte

38222 Posts

Posted - May 29 2021 :  20:09:52  Show Profile  Reply
Hi

If it is a layer object, you can use LayerNotify:

https://www.imageen.com/ievolutionhelp/html/6b7f6e09-2679-1ae0-d58e-b499ca8aac5c.htm

Otherwise you should use the MouseMove event.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Deeron

67 Posts

Posted - May 31 2021 :  05:20:10  Show Profile  Reply
Hi Nigel,

The position and size of the annotation are not updated for the MouseMove event (IEVolution .Net v8.0.0.0).
I can't query in real time with mouse move. :(

    public partial class Form1: Form
    {
        private IEObjectLine ieobjectline;
        public Form1()
        {
            InitializeComponent();
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ieobjectline = (IEObjectLine)ieViewer1.Image.Annotations.GetTemplateObject(IEObjectType.Line);

            ieobjectline.Name = "Line";
            ieobjectline.Left = 0;
            ieobjectline.Top = 100;
            ieobjectline.Width = 200;
            ieobjectline.Height = 1;
            ieobjectline.Transparency = 255;
 
            ieobjectline.PenWidth = 1;
            ieobjectline.PenColor = new IERGB(Color.Black);
            ieobjectline.PenStyle = IEPenStyles.Solid;

            ieViewer1.EnableObjectInserting = IEViewer.ObjectInserting.Line;

        }

        private void ieViewer1_MouseMove(object sender, MouseEventArgs e)
        {
            if (ieobjectline != null)
            {
               Console.WriteLine(ieobjectline.Left.ToString() + ", " + ieobjectline.Top.ToString() + ", " + ieobjectline.Width.ToString() + ", " + ieobjectline.Height.ToString());

            }

        }

}


I have a remark:
The "ieViewer1.Image.Annotations.SelectedObjectsCount" property correctly returns the number of annotations selected, but the
'ieobjectline' "Selected" property does not work, its value is always false if the annotation is selected, if not.


Go to Top of Page

xequte

38222 Posts

Posted - May 31 2021 :  18:59:30  Show Profile  Reply
Hi Deeron

I'll need to check if there is alternative method. You might be better to use layers instead of objects.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: