HowTo : Draw a circle round the cursor while moving the mouse
Article | 60000803 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 3/5/2009 |
Submitted by | Bob Hosea |
Keywords | |
Subject
Draw a circle round the cursor while moving the mouse
Summary
I want to draw a circle round the cursor while I move the mouse. I don't have any active action, and I tryed to use the MouseMove event but the results were not correct. How do I do this ?
Solution
You should use the OnActionDraw event that fires without any active action also. Try a code like :
void
ActiveDocument_OnActionDraw(object sender, object action, bool isHideMode, ref bool cancel)
{
VectorDraw.Actions.BaseAction act = action as VectorDraw.Actions.BaseAction;
VectorDraw.Geometry.gPoint currentpoint = act.OrthoPoint;
VectorDraw.Professional.vdFigures.vdCircle circle = new VectorDraw.Professional.vdFigures.vdCircle();
circle.SetUnRegisterDocument(vdSC.BaseControl.ActiveDocument);
circle.setDocumentDefaults();
circle.Center = currentpoint;
circle.Radius =2.0;
circle.Draw(act.Render);
}