Prod.: Engine, ver.: 6, ID: 60000803, HowTo : Draw a circle round the cursor while moving the mouse

HowTo : Draw a circle round the cursor while moving the mouse

Article60000803
TypeHowTo
ProductEngine
Version6
Date Added3/5/2009
Submitted byBob 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);
}