Results 1 to 2 of 2

Thread: can you help with image magnify

  1. #1
    Join Date
    Oct 2008
    Posts
    48
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question can you help with image magnify

    http://www.dynamicdrive.com/dynamici...agemagnify.htm

    Hey guys, I am trying to figure out something with this script. In it's JS file, it let you set how many times you want it magnified by, let say 2x or 3x the original image. But how would I be able to set it to magnify to its natural image size, because it ends up being blurry when you magnify it by x2 or x3....

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The script does not know the actual, true dimensions of the image it's magnifying unfortunately. So in order to magnify to those dimensions, you'll need to some some quick math to figure it out. Lets say you have an image that's naively 300 x 450px, though initially, you want to display it as a thumbnail with width 50px. With a little Math you know the height should then be 75px:

    Code:
    <img src="test.gif" style="width:50px; height:75px" />
    Then, to magnify this thumbnail back to its native dimensions, you know the magnification should be 6x.
    DD Admin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •