Prod.: Engine, ver.: 6, ID: 60001572, HowTo : I would like vdPoint to be drawn as filled circles

HowTo : I would like vdPoint to be drawn as filled circles

Article60001572
TypeHowTo
ProductEngine
Version6
Date Added12/8/2011
Submitted byPaul Bawin
Keywords

Subject

I would like vdPoint to be drawn as filled circles

Summary

I would like vdPoints to be drawn as filled circles, How can I do this ?

Solution

You need to cancel the draw of the vdPoint and draw your own object there like :
private void Form1_Load(object sender, EventArgs e)
{
  vdFramedControl1.BaseControl.ActiveDocument.OnDrawFigure += new vdDocument.FigureDrawEventHandler(ActiveDocument_OnDrawFigure);
  vdFramedControl1.BaseControl.ActiveDocument.FreezeEntityDrawEvents.Push(false);
}
 
void ActiveDocument_OnDrawFigure(object sender, VectorDraw.Render.vdRender render, ref bool cancel)
{
    vdPoint pt = sender as vdPoint;
    if (pt != null)
    {// ok it is a vdPoint object
        double radius = render.PixelSize * 10; // 10 pixels radius !!!!
        vdCircle cir = new vdCircle(vdFramedControl1.BaseControl.ActiveDocument, pt.InsertionPoint, radius);
        cir.HatchProperties = new vdHatchProperties(VectorDraw.Professional.Constants.VdConstFill.VdFillModeSolid);
        cir.HatchProperties.FillColor.FromSystemColor(Color.Red);
        cir.HatchProperties.FillColor.AlphaBlending = 80; // make it also a bit transparent 
        cir.Draw(render);
        cancel = true; // do not draw the "default" vdPoint
    }
// else do nothing !!!
}
Note that this kind of points will slow down the draw/redraw of the screen if you have a lot of vdPoints in the drawing.