Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Changing/switching image in iipMooViewer2beta

Help
2011-10-11
2013-05-08
  • Lutz Biedinger
    Lutz Biedinger
    2011-10-11

    in the current beta version of iipMooViewer 2, what is the best way of
    switching the displayed image within the same Viewer?

    I tried calling initialize() with the new image set in the options, but events
    such as the rotation(and other things) are added again too. So for n image
    changes the rotate event will be called n times when it is triggered. Also
    there probably is no need to initialize the whole thing again anyways.

    Cheers,
    Lutz

     
  • Ruven
    Ruven
    2011-10-11

    It depends what you are trying to do. Are you looking to blend between images?
    Or do you simply want to update the viewer with a single new image? If so, the
    viewer is not really designed to handle this. If your new images are the same
    size, it'll work by simply changing the variable iip.images.src to point to
    your new image.

     
  • Lutz Biedinger
    Lutz Biedinger
    2011-10-12

    I need to update the viewer with a new single image.
    What I've done is mucked about in the viewer and implemented a swapImage()
    function that clears the canvas, switches images and then calls a new
    recreateWindows() function which is pretty much a striped down version of
    createwindows() without any new eventhandlers added. recreateWindows also
    destroys the navcontainer before it adds a new one. It's not perfect, but it
    does the job and it'll do for now :-)

    Cheers,
    Lutz

     
  • Ruven
    Ruven
    2011-10-13

    I'll try to include an easier way to switch between images in the full release
    of IIPMooViewer 2

     
    • Fabio T.
      Fabio T.
      2013-04-30

      Hello Ruven, thank you very much for the beautiful software.

      I'm interested in this feature too.

      Are there any news or should I stick to the initialize() way? Am I missing any new functionality?

      I'm running iipmooviewer 2.0 beta at the moment, I've got it from the august 26th 2011 blog post. I suppose it's the latest release, please correct me if I'm wrong.

      Thanks in advance for helping.
      Best regards,
      Fabio

       
      Last edit: Fabio T. 2013-04-30
      • Ruven
        Ruven
        2013-04-30

        In the latest github version, there is now a changeImage() function, which allows you to pass in a new image path and load the image without reloading the page or iframe:

        https://github.com/ruven/iipmooviewer

         

        • Anonymous
          2013-05-08

          Thanks! I'll give it a try!

          Fabio

           

        • Anonymous
          2013-05-08

          Thanks! I'll give it a try!

          Cheers
          Fabio

           
  • DGSL
    DGSL
    2011-10-13

    I don't understand the problem. For showing a new image, is this not as simple
    as reloading the DIV or IFRAME which contains the viewer, changing the image
    parameter each time?

     
  • Lutz Biedinger
    Lutz Biedinger
    2011-10-13

    That's a simple way of doing it, but not the most efficient scince we're
    loading the entire thing again even though everything is already there. Also
    as i mentioned originally I had problems with functions that are attatched to
    keydown events sticking around on those events.

     


Anonymous


Cancel   Add attachments