Rank: Newbie
Groups: Guest
Joined: 3/17/2008(UTC) Posts: 8
|
(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
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
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. |
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 3/17/2008(UTC) Posts: 8
|
thank for your answer; what you suggest is useful also if the user move the object with mouse for a while?
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
Hello, Yes, of course. VObject.Transform stores all transformations which were made with the object. |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.