Rotating images and different image dimensions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Rotating images and different image dimensions

    I am rotating images at one location of my web site. My problem is if
    I set the width and height of the new image before I show the new
    image, the old image is stretched first to the new image dimensions,
    and if I show the new image before setting its dimensions, the new
    image is stretched first to the old image dimension before it is
    adjusted to its own dimension.
    I would like to load a new image with its own dimension at the same
    time. How can I do this?


    thank you
    John
  • Ivo

    #2
    Re: Rotating images and different image dimensions


    "John" wrote[color=blue]
    > I am rotating images at one location of my web site. My problem is if
    > I set the width and height of the new image before I show the new
    > image, the old image is stretched first to the new image dimensions,[/color]
    <snip>
    Can we see your current code (only the relevant bits, but all of them, and
    not exceeding 72(?) characters per line, with some indentation and perhaps a
    few well-chosen whitelines)? If not, any suggestion we make is as much to
    the point as anything you can read at dynamicdrive.co m.

    The magic word is preload.
    HTH
    Ivo


    Comment

    • Lee

      #3
      Re: Rotating images and different image dimensions

      John said:[color=blue]
      >
      >I am rotating images at one location of my web site. My problem is if
      >I set the width and height of the new image before I show the new
      >image, the old image is stretched first to the new image dimensions,
      >and if I show the new image before setting its dimensions, the new
      >image is stretched first to the old image dimension before it is
      >adjusted to its own dimension.
      > I would like to load a new image with its own dimension at the same
      >time. How can I do this?[/color]

      Off the top of my head:

      1. change the image to something amorphous, change the dimensions,
      then change to your new image. The intermediate image could be
      a solid color (white?) or it could be some sort of swirl to give
      the impression of an image being rotated.

      2. change the visibility of the image to hidden, update it, then
      set it back to visible.

      3. rewrite the entire <img> tag with the new image and dimensions.

      Do all popular browsers allow you to change the dimensions of images
      on the fly these days? Some older ones wouldn't allow that.




      Do most current browsers allow you to change the dimensions of an
      image after it's been rendered? Some older browsers won't.

      Comment

      • John

        #4
        Re: Rotating images and different image dimensions

        Lee <REM0VElbspamtr ap@cox.net> wrote in message news:<c937sl01f rj@drn.newsguy. com>...[color=blue]
        > John said:[color=green]
        > >
        > >I am rotating images at one location of my web site. My problem is if
        > >I set the width and height of the new image before I show the new
        > >image, the old image is stretched first to the new image dimensions,
        > >and if I show the new image before setting its dimensions, the new
        > >image is stretched first to the old image dimension before it is
        > >adjusted to its own dimension.
        > > I would like to load a new image with its own dimension at the same
        > >time. How can I do this?[/color]
        >
        > Off the top of my head:
        >
        > 1. change the image to something amorphous, change the dimensions,
        > then change to your new image. The intermediate image could be
        > a solid color (white?) or it could be some sort of swirl to give
        > the impression of an image being rotated.
        >
        > 2. change the visibility of the image to hidden, update it, then
        > set it back to visible.
        >
        > 3. rewrite the entire <img> tag with the new image and dimensions.
        >
        > Do all popular browsers allow you to change the dimensions of images
        > on the fly these days? Some older ones wouldn't allow that.
        >
        >
        >
        >
        > Do most current browsers allow you to change the dimensions of an
        > image after it's been rendered? Some older browsers won't.[/color]


        I have tried changing the visibility to hidden and then back to
        visible but its not working. I don't know how to make a swirl, but I
        would prefer not to have effects. I am firing the event onmouseover to
        show the images so I don't think its possible to write the <img> tag,
        but I would welcome your suggestion of how I can do it.

        thank you

        Comment

        • John

          #5
          Re: Rotating images and different image dimensions

          johnmark@faster mail.com (John) wrote in message news:<1ab390bb. 0405270846.468b 38e@posting.goo gle.com>...[color=blue]
          > Lee <REM0VElbspamtr ap@cox.net> wrote in message news:<c937sl01f rj@drn.newsguy. com>...[color=green]
          > > John said:[color=darkred]
          > > >
          > > >I am rotating images at one location of my web site. My problem is if
          > > >I set the width and height of the new image before I show the new
          > > >image, the old image is stretched first to the new image dimensions,
          > > >and if I show the new image before setting its dimensions, the new
          > > >image is stretched first to the old image dimension before it is
          > > >adjusted to its own dimension.
          > > > I would like to load a new image with its own dimension at the same
          > > >time. How can I do this?[/color]
          > >
          > > Off the top of my head:
          > >
          > > 1. change the image to something amorphous, change the dimensions,
          > > then change to your new image. The intermediate image could be
          > > a solid color (white?) or it could be some sort of swirl to give
          > > the impression of an image being rotated.
          > >
          > > 2. change the visibility of the image to hidden, update it, then
          > > set it back to visible.
          > >
          > > 3. rewrite the entire <img> tag with the new image and dimensions.
          > >
          > > Do all popular browsers allow you to change the dimensions of images
          > > on the fly these days? Some older ones wouldn't allow that.
          > >
          > >
          > >
          > >
          > > Do most current browsers allow you to change the dimensions of an
          > > image after it's been rendered? Some older browsers won't.[/color]
          >
          >
          > I have tried changing the visibility to hidden and then back to
          > visible but its not working. I don't know how to make a swirl, but I
          > would prefer not to have effects. I am firing the event onmouseover to
          > show the images so I don't think its possible to write the <img> tag,
          > but I would welcome your suggestion of how I can do it.
          >
          > thank you[/color]


          Is there someone out there who can help me with this problem?

          John

          Comment

          • to heave chunks

            #6
            Re: Rotating images and different image dimensions

            >Is there someone out there who can help me with this problem?

            Have you tried loading a transparent gif image before loading the new picture?
            Sort of like a buffer image that you can resize.

            Have you tried not setting the height and width of the IMG tag?

            Peace, Vm
            Yaz

            Providing complicated solutions to simple problems since 1997.

            Comment

            Working...