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

ZoomChanged Event affects annotations

Last post 02 Dec 2007, 12:45 AM by David Cilley. 1 replies.
Sort Posts: Previous Next
  •  23 Nov 2007, 7:08 PM 12794

    ZoomChanged Event affects annotations

    I have attached a method to the ZoomChanged event in javascript to update a label of the current zoom percentage of the view. When ever this event is attached the annotations will not zoom in or out with the image. Am I doing something wrong by attaching to the zoomchanged event or is this a bug or is there another way i can get the current zoom percentage of the viewer whenever it changes?

     Thanks,

    Colin

  •  02 Dec 2007, 12:45 AM 12825 in reply to 12794

    Re: ZoomChanged Event affects annotations

    The WebAnnotationViewer needs to bind to the parent WebImageViewer's ZoomChanged event, setting this to a function of your own instead of using atalaEventAdd will cause it to break all annotation specific operations (such as automatically resizing annotations)

    This is the recommended way to attach to this event:

    atalaInitClientScript('OnPageLoad();');

    function OnPageLoad(){
       atalaEventAdd(this, WebAnotationViewer1, 'ZoomChanged', OnZoomChanged);
    }

    function OnZoomChanged(){
       // do stuff ...
    }


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