+ Reply to Thread
Results 1 to 5 of 5

Rotating picture inside image control

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,759

    Rotating picture inside image control

    Hi,

    I have a userform containing a listbox that loads all my jpg files in it and one image control that shows the picture of selected item of listbox

    My question is how can we rotate and zoom the picture inside the image control?

    Help would be greatly appreciated

    Best Regards
    Imran Bhatti
    Teach me Excel VBA

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

    Re: Rotating picture inside image control

    Zoom can be done by placing the image control within a frame and setting the image property to Stretch. Increase the size of the image within the frame and provide some UI to allow the user to move the image around within the frame.

    Rotation is not supported within the control so you would need to manipulate the image and then reload it.
    This may be of some help.
    http://andypope.info/vba/userformdraw.htm
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,759

    Re: Rotating picture inside image control

    Thanks Sir Andy for the review.

    The Demo in the link is really magical but nowhere I was able to see about rotating an image.

    I have attached a sample of my userform that will ask for a folder containing ".jpg" or "jpeg" files.
    Attached Files Attached Files

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

    Re: Rotating picture inside image control

    There is not anything currently in that code to deal with images or rotation. You would need to extend the code.
    What you should see from the code though is that it is possible to create a shape on a worksheet and then load it, as an image, in to a container on the userform.

    You can manipulate the shape on the worksheet with all the properties a shape has, which includes rotation.

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

    Re: Rotating picture inside image control

    Try this simple version.

    It just uses a empty worksheet to store images whilst the userform is open.
    The picture on the sheet can be rotated and with the PastePicture function it can be loaded into an image.
    The image is contained within a frame so it can use the built in zoom method of the frame.
    Attached Files Attached Files

+ 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. Load picture using image control
    By hjoemark27 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-18-2018, 09:07 AM
  2. Save Image Control Picture to PC
    By AmirSoft in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2015, 10:45 PM
  3. [SOLVED] show jpeg picture inside a userform image control box
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 07-29-2013, 03:44 PM
  4. Remove picture from Image Control?
    By Jon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2006, 09:45 PM
  5. [SOLVED] [SOLVED] Programatically control picture property of Image control
    By Brassman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-24-2005, 05:06 PM
  6. Programatically control picture property of Image control
    By Brassman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2005, 10:11 AM
  7. Copy picture from image control
    By Ian in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2005, 11:06 AM

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