This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

How to get coordinate of a LineVobject

(1) I add a LineVobject with this code:

//Create a line object
Aurigma.GraphicsMill.WinControls.LineVObject line = new
Aurigma.GraphicsMill.WinControls.LineVObject(X1, Y1,X2, Y2 );

//Modify stroke and fill parameters
line.Pen = new System.Drawing.Pen(System.Drawing.Color.Black, 2);
line.Brush = new System.Drawing.SolidBrush(System.Drawing.Color.Transparent);

//Add the rectangle to a layer
//vobj is VObjectsRubberband associated with the bitmapviewer
vobj.Layers[0].VObjects.Add(line);

(2) I move the object with the mouse and then i need new (x1,y1) and (x2,y2) coordinate:
-obj.GetVObjectBounds(); give me the original rectangle that contains the line
-obj.GetControlPointsBounds(); give me the new rectangle that contains the line

The question is that there is no a property such as Points (like in the PolylineVObject). How can i get the new line coordinate?

thank in advance
Hi

No, unfortunately there is no public propery for this. However, as you know matrix from VObject.Transform property, so you can always apply it to the inital points and get current coordinates.

So, I think that the best way is to inherit new class from the existing LineVObject and implement such properties as Point1 and Point2 via matrix transformations.
thank for your answer; what you suggest is useful also if the user move the object with mouse for a while?
Hello,

Yes, of course. VObject.Transform stores all transformations which were made with the object.