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

Notification

Icon
Error

Options
Go to last post Go to first unread
stefano1403  
#1 Posted : Monday, April 28, 2008 9:44:11 PM(UTC)
stefano1403

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

Alex Kon  
#2 Posted : Monday, April 28, 2008 11:40:03 PM(UTC)
Alex Kon

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.

stefano1403  
#3 Posted : Tuesday, April 29, 2008 1:28:31 AM(UTC)
stefano1403

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?
Alex Kon  
#4 Posted : Tuesday, April 29, 2008 2:24:35 PM(UTC)
Alex Kon

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.

Users browsing this topic
Guest (3)
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.