+ Reply to Thread
Results 1 to 3 of 3

Pan on a zoomed-in image on a userform

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Pan on a zoomed-in image on a userform

    This is going to be difficult for me to describe so if please let me know if any clarification is required.

    I have an image in a frame on a userform. I want to be able to:
    1. click on the image to zoom in
    2. to zoom out, I click on the image again (In other words, a left click works as a toggle. If image is already zoomed in, it will revert to full size. If image is currently displayed full size, it will zoom in)
    3. While I am zoomed into the image, I want to be able "grab" the image by holding down left click and, while grabbing, "pan" the image around. (So that a different section of the image is visible inside the frame)

    The first two objectives are easy. But I am stuck on the last one. Can anybody help?

    The closest to what I am looking for is Andy Pope's brilliant Magnify Image (see https://www.andypope.info/vba/magnifyimage.htm) The difference is that his has a 2nd image which acts as a magnifying glass on top of the first image. Whereas I want to zoom into the same image and then pan it around inside its frame.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,098

    Re: Pan on a zoomed-in image on a userform

    I don't think it will work as you expect if left button controls both zoom and pan.
    This example uses double-click to zoom and held left to pan.

    Please Login or Register  to view this content.
    The userform has 2 controls.
    Frame1 which contains Image1
    Image1 contains the image
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Pan on a zoomed-in image on a userform

    I didn't expect my question to be answered by Andy Pope himself Thank you very much and reps. That was what I was looking for.


    The only edits I made after were because I hadn't made these requirements clear in my opening post (1. While the image isn't zoomed in, I want the entire image to be visible (not cropped). 2. Logical consequence of that - panning should only be possible while the user is zoomed into the image) Thankfully these minor tweaks were easy to implement.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Image Pop Up on Mouse Hover over image on userform
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-31-2019, 04:43 PM
  2. Inserting image into userform label, text behind image?!?!
    By spyrule in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 08-31-2016, 03:23 PM
  3. Replies: 1
    Last Post: 07-14-2016, 04:59 AM
  4. [SOLVED] Using a Userform to Browse image file then paste selected image to sheet?
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2015, 05:42 PM
  5. [SOLVED] How to apply Image borders to an image that my excel vba userform pastes in a word doc?
    By CaptainCool in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2014, 05:40 PM
  6. [SOLVED] VBA to transfer image FROM userform image control TO a worksheet cell
    By Zoediak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 02:51 PM
  7. Zoomed view of an image control
    By mizamae in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2014, 04:43 AM

Tags for this Thread

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1