Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Custom Annotation Visibility

Last post 17 Mar 2008, 6:50 AM by Rupesh. 1 replies.
Sort Posts: Previous Next
  •  16 Jan 2008, 12:17 PM 12982

    Custom Annotation Visibility

    Hi,

    I have been trying to create a new Custom Annotation and have managed to get it working, however I found that when toggleing the Visible option the Annotation appears to still be there (although not selectable). It looks like the Annotation is burnt into Layer!

     I tried this on the DotAnnotateDemo app using the Custom Triangle Annotation and it does the same.

    Is there a fix for this? or is there somethign extra that the Custom Annotation needs to force the Layer to be refershed?

     Thanks,

     Louis

  •  17 Mar 2008, 6:50 AM 13492 in reply to 12982

    Re: Custom Annotation Visibility

    Below is the code given in the sample application of Triangle. The statement "if (annotation.Visible == false) return;" has been missed out in the sample in the method RenderAnnotation in the class TriangleRenderingEngine.

     

    public class TriangleRenderingEngine : Atalasoft.Annotate.Renderer.AnnotationRenderingEngine

    {

    public TriangleRenderingEngine()

    {

    // We will use our own custom grip renderer.

    // We could simply override the RenderGrips method as well.

    //this.GripRenderer = new MyCustomGripRenderer();

    }

    public override void RenderAnnotation(AnnotationData annotation, Atalasoft.Annotate.Renderer.RenderEnvironment e)

    {

    // Perform a basic check.

    TriangleData data = annotation as TriangleData;

    if (data == null) return;

    if (data.Fill == null) return;

    if (annotation.Visible == false) return;

    // SetGraphicsTransform handles combining multiple

    // transformation matrix objects so you can render normally.

    base.SetGraphicsTransform(annotation, e);

    Brush b = CreateBrush(data.Fill);

    :
    :
    :
    :

     

    Hope this solves your problem.

View as RSS news feed in XML