Need to change behavior of web object

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • eric_darling
    Indigo Rose Customer
    • Jun 2002
    • 1805

    Need to change behavior of web object

    This is a slight problem, which probably affects no one but me. I am in the midst of a large project where it's all about the web object as my "interface within a runtime" project, and I've run across an incorrect behavior of the web object.

    Many of the graphics I have loading into the web object are so large that IE and/or Firefox need to scale these down upon loading so that the entire viewable area is in the window. Each of these browsers gives you zoom tool when you hover over the image.

    AMS doesn't do this via the web object. I think it should.

    The images load fine, but they are so large due to not being scaled automatically, that the user can simply miss it altogether as they are just seeing a corner of the actual viewable area.

    Since the web standard is to provide a simple solution via the auto scale/magnifying glass cursor trick, I think it should be part and parcel of the web object's behavior in AMS. Who's with me?
    Eric Darling
    eThree Media
    http://www.ethreemedia.com
  • yosik
    Indigo Rose Customer
    • Jun 2002
    • 1858

    #2
    I haven't had this problem, but I Am with you. This functionality should be integrated into the web object.
    Yossi

    Comment

    • eric_darling
      Indigo Rose Customer
      • Jun 2002
      • 1805

      #3
      Thanks for the moral support, Yossi!
      Eric Darling
      eThree Media
      http://www.ethreemedia.com

      Comment

      • longedge
        Indigo Rose Customer
        • Aug 2003
        • 2498

        #4
        I have to agree with you also Eric, the web object should 'perform' in the same way that a user would see if they were browsing with IE or FF etc.

        I wasn't aware of this and I wonder what, if any, other differences there might be between using a web browser and the web object.

        Comment

        • eric_darling
          Indigo Rose Customer
          • Jun 2002
          • 1805

          #5
          Yeah, I think anymore it's an expected behavior dating back several major browser versions ago. I was disappointed to learn that AMS' web object doesn't do it, since I'm counting on it to work like that.
          Eric Darling
          eThree Media
          http://www.ethreemedia.com

          Comment

          • Ulrich
            Indigo Rose Staff Member
            • Apr 2005
            • 5130

            #6
            It seems that Microsoft's WebBrowser control, which was the component used for building the Web Object in AMS, doesn't support the image resizing. After searching for a solution to your problem I found several people asking this exact question about the WebBrowser control, even on the MSDN board, and there was no reply at all showing how this could be possible, unless somebody builds a new web control from scratch.

            But there is another easy solution for your problem, just using some Javascript, to at least load the whole image in the viewable area. I have set up an example project for you here, it is a blank page with a Web Object on it, pointing to a html with an image and some text (included in the project). To see it in action, stretch/resize the Web Object as you wish, preview the project, and you'll see that the image will adapt itself to the available width and height of the Web Object, keeping the aspect. Keep in mind that the Web Object reserves a border for scrollbars, so you may have to mask this space out. The Javascript is pretty straightforward, and you should be able to make any modifications to fit your needs with ease. Unfortunately this won't give you the zoom, though.

            Ulrich
            Attached Files
            Last edited by Ulrich; 07-12-2008, 11:33 PM.

            Comment

            • eric_darling
              Indigo Rose Customer
              • Jun 2002
              • 1805

              #7
              Thanks Ulrich, but wouldn't this code need to be tailored uniquely for each different image size? I have 548 or so images, all of differing sizes.
              Eric Darling
              eThree Media
              http://www.ethreemedia.com

              Comment

              • Ulrich
                Indigo Rose Staff Member
                • Apr 2005
                • 5130

                #8
                Not at all. If you name your images in such a way that they can be found through a loop, you can resize them all together to fit best the available space.

                In the new example, I try to resize three images in such a way that they fit best in the current width and height in the Web Object, through a simple loop. (If you need them to fit only horizontally, just make the adjustments.)

                Hope this helps.

                Ulrich
                Attached Files

                Comment

                • longedge
                  Indigo Rose Customer
                  • Aug 2003
                  • 2498

                  #9
                  If it's of interest, Sside posted a dll which re-sizes images and works really well in this thread.

                  Comment

                  • eric_darling
                    Indigo Rose Customer
                    • Jun 2002
                    • 1805

                    #10
                    I think you've missed my point, Ulrich. I want to be able to load a straight image - not an HTML file which contains images embedded. Web browsers do this very well, but the web object does not.

                    If I were to use your code, it wouldn't solve my issue - I'd have to create 548 NEW HTML pages instead of having what I consider a missing feature implemented. If it's impossible as you've suggested it could be earlier in this thread, I'll figure out a different method, such as just launch the index.html interface that I've already built into a web browser and be done with it. Still, I'd like to use the AMS project if possible.
                    Eric Darling
                    eThree Media
                    http://www.ethreemedia.com

                    Comment

                    • RizlaUK
                      Indigo Rose Customer
                      • May 2006
                      • 5552

                      #11
                      you would not need 500+ new html pages, you can write the html dynamicly for each image, all you need to know is the image name and size, AMS can work with this information and rewrite the html/javascript for each image as its loaded

                      i know its not an ideal solution, but its a quick fix to get the project finished

                      FYI, this is also a problem in the PureBasic web object but with the functions provided in PB its easy to *inject* the new html into the web object withut writeing a html file, it would be nice to be able to do this in AMS as well.
                      Embrace change in your life, you never know, it could all work out for the best

                      Comment

                      • eric_darling
                        Indigo Rose Customer
                        • Jun 2002
                        • 1805

                        #12
                        Yeah, I misspoke. I already have that many HTML pages. I mean, I'd need to re-write 'em.
                        Eric Darling
                        eThree Media
                        http://www.ethreemedia.com

                        Comment

                        Working...
                        X