zoom In/zoom Out an Image

Discussion in 'Java' started by dwurity@gmail.com, Feb 14, 2005.

  1. Guest

    Hi
    I am developing an applet application, in which I have placed an
    Image, now I want the Image to Zoom In and Zoom Out, how can I do
    this.....

    Thanks in advance
    dwurity
    , Feb 14, 2005
    #1
    1. Advertising

  2. jfalt Guest

    Zoom in and zoom out use the exact same techniques.
    The Graphics2D translate() method sets the top left corner of the
    viewable image. The translation happens *after* the image has been
    scaled..so your numbers need to be scaled.

    For zooming in and zooming out, just use values that are inverses of
    each other. For example, if you zoom in 1.25 each time, such that each
    time you zoom, your scale *= 1.25, then to zoom out, your scale *= .8
    (or scale /= 1.25)
    jfalt, Feb 15, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    733
    Keith James
    Feb 14, 2005
  2. Replies:
    0
    Views:
    422
  3. Replies:
    0
    Views:
    336
  4. Replies:
    2
    Views:
    863
  5. Miguel Ángel Esbrí

    How to zoom in and out an image?

    Miguel Ángel Esbrí, Jul 3, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    158
    Miguel Ángel Esbrí
    Jul 3, 2003
Loading...

Share This Page