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

Ajax webimageviewer coding

Last post 05 Sep 2007, 5:48 PM by David Cilley. 5 replies.
Sort Posts: Previous Next
  •  17 Oct 2006, 7:16 AM 10988

    Ajax webimageviewer coding

    Hi,

    (1)
    I have read the clientside scripting section within the help file but I am still confused as to how you code the ajax viewer. For example, when can you use javascript only and when do you need to use javascript and a remoteinvoke vb function?

    eg,
    For a zoom in I only use javascript

    For a rotate I need to use javascript and a remoteinvoke vb function.

    This is confusing.

    (2)
    Public Functions
    All public functions and global variables that are included within WebImageViewer.js, WebThumbnailViewer.js, ClientTools.js, and Enums.js are prefixed with the word "atala".  This makes it unlikely that another component you might be using on the same page would have similar function names.

    The help file indicates that these .js files with routines exist. When you open them they are on
    one line and are therefore unreadable.

    Thanks for the help.

    Graham O'Riley

    Netdocs Plc.

     

  •  17 Oct 2006, 10:26 AM 10990 in reply to 10988

    Re: Ajax webimageviewer coding

    (1)

    One thing that you need to keep in mind is that the image and all code that can manipulate the image must be executed on the server.  The image is not stored on the client like it could be in an ActiveX, No-Touch Deploy, or Java applet, so only basic things will be available on the client side using JavaScript.

    Zooming in or out is something that the control was designed to handle on the client right out of the box.  This is why you can zoom in or out using JavaScript.  Zooming in or out doesn't actually change the image at all, it just changes what we see.  A rotate does alot more to the image than a zoom, and since the underlying image changes size there is work that needs to be done on the server.

    You can set all of the WebImageViewer's properties (get/set) using JavaScript, you cannot 'do work' on the image in JavaScript.  A basic rule of thumb is that if the underlying image changes in any way, you will need to use RemoteInvoke.  For viewing changes, like panning, zooming, or fitting, we can take shortcuts (these are properties).  We use these shortcuts to optimize the user experience.

    (2)

    The .js files were never meant to be viewed, as the documentation describes all public 'atala' functions that you have access to.  The .js files have been compressed to make the control load faster.  The statement is in the documentation so that you can name your own public methods without conflict.

    In the past, certain components have named their constructors so generically that they interfered with our users' code.  We prefix all of our functions with atala so if you (or any 3rd party components) name a JavaScript function WebImageViewer on the same page, it won't conflict with ours (atalaWebImageViewer).


    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  17 Oct 2006, 10:36 AM 10992 in reply to 10990

    Re: Ajax webimageviewer coding

    Thanks for the reply.

    1) I suppose for me it's trial and error then until I know myself which type of coding  is required.

    2) I'm still not sure where these files fit in.

    Are we as coders supposed to use them to enable a ajax viewer?

    How do we know what is in them? How do we know how to use them?

    Do we include them in our bin folder?

    Thanks,

    Graham.

     

  •  17 Oct 2006, 11:53 AM 10995 in reply to 10992

    Re: Ajax webimageviewer coding

    (2) They are automatically included in the page... you don't need to do anything.  You do not need to use the files themselves at all, they are there to create the objects you use.  The objects that are created on the page are all that you need to access.  For example, you access the WebImageViewer1 object, and the documentation pertains to that object.
    David Cilley
    My AJAX Imaging Blog
    Atalasoft Development Team
  •  05 Sep 2007, 4:47 PM 12542 in reply to 10995

    Re: Ajax webimageviewer coding

    I am having problems with this.  Besides including the viewer on the page, is there anything else I would need to do?  I have the following code snippet:

        <script id="annotationScripts" language="javascript">
        <!--
            atalaInitClientScript("OnPageLoad()");
            function OnPageLoad()
            {
                alert("Page is finished loading.");
            }
        -->
        </script>

    I get an error on the atalaInitClientScript() that states: Object Expected.

     it seems that that method isnt accessable.

     thanks,

     brian

  •  05 Sep 2007, 5:48 PM 12544 in reply to 12542

    Re: Ajax webimageviewer coding

    You will need to make sure that the code snippet you provided is placed and executed after the WebImageViewer's location in the page.  You cannot place atalaInitClientScript calls in the header because the corresponding Atalasoft .js libraries have not been referenced yet.  You will basically need to structure it like this:

    <body>
    <form ...>
    <WebImageViewer ... />
    <snippet here>
    </form>
    </body>


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