Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Zoom in and Zoom out feature in a picturebox

Zoom in and Zoom out feature in a picturebox

Scheduled Pinned Locked Moved C#
csharpdotnet
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alfie max15
    wrote on last edited by
    #1

    Hi there, I am using VS2012 and .NET Framework 4.5 I am making a simple picture viewer. I have completed, Creating a picture viewer, which has open, previous, and next buttons. Now i was wondering how i can add in the Zoom feature into this. What i exactly want is, according to mouse wheel movement the picture should zoom in or out corresponding to direction of rotation of the mouse wheel. Also the image should zoom in or out based on the point where the mouse pointer is currently present. One more thing, the picture viewer is fullscreen at all time. I hope somebody could reply soon... Thank you

    J L S B 4 Replies Last reply
    0
    • A alfie max15

      Hi there, I am using VS2012 and .NET Framework 4.5 I am making a simple picture viewer. I have completed, Creating a picture viewer, which has open, previous, and next buttons. Now i was wondering how i can add in the Zoom feature into this. What i exactly want is, according to mouse wheel movement the picture should zoom in or out corresponding to direction of rotation of the mouse wheel. Also the image should zoom in or out based on the point where the mouse pointer is currently present. One more thing, the picture viewer is fullscreen at all time. I hope somebody could reply soon... Thank you

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Take a look at https://www.google.com/search?q=.net+image+zoom[^]. The first two are CodeProject articles on the subject.

      Veni, vidi, abiit domum

      1 Reply Last reply
      0
      • A alfie max15

        Hi there, I am using VS2012 and .NET Framework 4.5 I am making a simple picture viewer. I have completed, Creating a picture viewer, which has open, previous, and next buttons. Now i was wondering how i can add in the Zoom feature into this. What i exactly want is, according to mouse wheel movement the picture should zoom in or out corresponding to direction of rotation of the mouse wheel. Also the image should zoom in or out based on the point where the mouse pointer is currently present. One more thing, the picture viewer is fullscreen at all time. I hope somebody could reply soon... Thank you

        J Offline
        J Offline
        JV9999
        wrote on last edited by
        #3

        Guessing for your text, you will need to built the zoom functionality yourself (Which is actually quite easy btw). Just catch the mouse scroll and recalculate the amount of pixels to show. Ie; Zoom in once; 1px becomes 4pxs etc..

        1 Reply Last reply
        0
        • A alfie max15

          Hi there, I am using VS2012 and .NET Framework 4.5 I am making a simple picture viewer. I have completed, Creating a picture viewer, which has open, previous, and next buttons. Now i was wondering how i can add in the Zoom feature into this. What i exactly want is, according to mouse wheel movement the picture should zoom in or out corresponding to direction of rotation of the mouse wheel. Also the image should zoom in or out based on the point where the mouse pointer is currently present. One more thing, the picture viewer is fullscreen at all time. I hope somebody could reply soon... Thank you

          S Offline
          S Offline
          Snehasish_Nandy
          wrote on last edited by
          #4

          Apart from the links provided you can check this how-to-zoom-in-and-zoom-out-a-image-in-picturebox-using-mouse-wheels-in-c[^]

          1 Reply Last reply
          0
          • A alfie max15

            Hi there, I am using VS2012 and .NET Framework 4.5 I am making a simple picture viewer. I have completed, Creating a picture viewer, which has open, previous, and next buttons. Now i was wondering how i can add in the Zoom feature into this. What i exactly want is, according to mouse wheel movement the picture should zoom in or out corresponding to direction of rotation of the mouse wheel. Also the image should zoom in or out based on the point where the mouse pointer is currently present. One more thing, the picture viewer is fullscreen at all time. I hope somebody could reply soon... Thank you

            B Offline
            B Offline
            BillWoodruff
            wrote on last edited by
            #5

            CodeProject is your friend: [^], [^]. For an old (but still relevant, imho) caution against using the PictureBox to pan and zoom: [^].

            If you seek to aid everyone that suffers in the galaxy, you will only weaken yourself … and weaken them. It is the internal struggles, when fought and won on their own, that yield the strongest rewards… If you care for others, then dispense with pity and sacrifice and recognize the value in letting them fight their own battles." Darth Traya

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups