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

rotate annotation

Last post 22 Apr 2008, 10:31 AM by David Cilley. 6 replies.
Sort Posts: Previous Next
  •  30 May 2007, 3:07 AM 12107

    rotate annotation

    Hi,

    I'm trying to rotate an annotation in the web version.

    I can do so when the annotation is created, but in a custom onclick event the WebAnnotationViewer.Annotations.Layers.Count always returns 1. Like I can't get a hold of any of the rubberstamp examples I'm using.

    I wan to use somthing like:

    WebAnnotationViewer.Annotations.Layers[i].Rotate(angle)

    does anyone know how I can do this?

     

    Filed under:
  •  30 May 2007, 9:24 AM 12110 in reply to 12107

    Re: rotate annotation

    With the example you provided, it looks more like you are attempting to rotate the Layer.  Layers.Count is most likely returning 1 because there is only one layer.  If you are trying to get the number of annotations on one layer, you will need to look at WebAnnotationViewer1.Annotations.Layers[i].Items.Count.  To access individual annotation methods and properties, you will need to cast each item in the Items collection to the specific type of annotation you are looking for.  Something like this:

    // untested code
    AnnotationUI ann = WebAnnotationViewer1.Annotations.Layers[i].Items[j];

    EllipseAnnotation ellipse = ann as EllipseAnnotation;
    if (ellipse != null)
    {
       ...
    }

    RectangleAnnotation rectangle = ann as RectangleAnnotation;
    if (rectangle != null)
    {
       ...
    }

    etc...


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
    Filed under:
  •  30 May 2007, 9:09 PM 12115 in reply to 12110

    Re: rotate annotation

    Excellent.

     

    Thanks very much David. I've just gone with

    WebAnnotationViewer1.Annotations.Layers[0].Items[0].Rotate(angle);

    And to make it apply the change I found I need to also call

    WebAnnotationViewer1.UpdateAnnotations();

     

    Cheers

  •  31 May 2007, 12:59 AM 12117 in reply to 12115

    Re: rotate annotation

    Actually is there also a way to do the rotation clientside in real time?

    I know we can resize real time but are rotations possible in the web forms version too?

     

  •  31 May 2007, 9:14 AM 12119 in reply to 12117

    Re: rotate annotation

    No, this is not possible in the current version.
    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  22 Apr 2008, 10:13 AM 13728 in reply to 12119

    Re: rotate annotation

    This code works well, but I'm wondering if what I need to do is different.

    I can get the annotations to rotate, but they rotate on their own axis and not relative to the images axis. In other words, we're not burning annotations, so when we rotate annotations, the annotations need to rotate properly from the perspective of the images layer and not the annotations own layer.

    Is this possible and, is there an easy way to accomplish this? Thanks...

  •  22 Apr 2008, 10:31 AM 13729 in reply to 13728

    Re: rotate annotation

    You are correct, rotating an annotation will only rotate the annotation.  It does not reposition it.  You will have to calculate and set the new position of the annotation, based on the rotation of the image.


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
View as RSS news feed in XML