Results 1 to 6 of 6

Zoom Image on UserForm

This is a discussion on Zoom Image on UserForm within the Excel Questions forums, part of the Question Forums category; How does one Zoom an Image on a UserForm? The help files say it's possib;e to Zoom, Crop, etc. but ...

  1. #1
    Board Regular Todd Bardoni's Avatar
    Join Date
    Aug 2002
    Location
    Rochester, MI USA
    Posts
    3,044

    Default Zoom Image on UserForm

    How does one Zoom an Image on a UserForm? The help files say it's possib;e to Zoom, Crop, etc. but I can't find any examples.

    Thanks.
    Todd
    Todd


    "I'm a Data Anlyst(intermediate) and have no idea what it's all about."

  2. #2
    New Member
    Join Date
    Oct 2002
    Location
    Denver, CO
    Posts
    49

    Default Re: Zoom Image on UserForm

    there is an option in the properties window called picture size mode...there is a zoom option there.

    -Kyle

  3. #3
    MrExcel MVP
    Int'l Moderator
    Greg Truby's Avatar
    Join Date
    Jun 2002
    Location
    39 17' 15" N, -94 40' 26" W
    Posts
    9,729

    Default

    I've got a UserForm at work where I used a scrollbar to adjust the zoom due to my users having a variety of resolution settings on their monitors. If no one gets you a full answer in the meantime, I'll post back tomorrow.

    Regards,
    Greg

    Work: XL 2003, 2007 and 2010 on Windows 7
    Please use CODE tags - especially for longer excerpts of code.

  4. #4
    MrExcel MVP
    Int'l Moderator
    Greg Truby's Avatar
    Join Date
    Jun 2002
    Location
    39 17' 15" N, -94 40' 26" W
    Posts
    9,729

    Default Re: Zoom Image on UserForm

    Todd,

    Back in the office now. Looks like it's just UserForm.Zoom = ____. Obviously, you don't need to use a scrollbar, you can set the zoom however you need to. But I found this a convenient tool to give the user.

    Code on the scrollbar:

    Code:
    Private Sub ScrollBarZoom_Change()
        UserFormReconcile2.Zoom = ScrollBarZoom.Value
        UserFormReconcile2.LabelZoom = "Zoom = " & ScrollBarZoom.Value
    End Sub
    Code in UserForm_Initialize

    Code:
        ScrollBarZoom.Max = 100
        ScrollBarZoom.Min = 50
        ScrollBarZoom.Value = 100
        UserFormReconcile2.Zoom = 100
    In addition to the scrollbar, I have a label beside it that tells the user the zoom factor. In my case, I was trying to make the form run on users that were still on 640 480 resolution, so I needed to shrink it. This is rather relevant because zoom does not resize the window. It makes the objects on the form smaller or bigger, but the frame of the window the form is displayed in does not change size. Since I was only shrinking and not enlarging, I didn't try to figure out how to alter the form's window's width & height in order enable it to work well at a zoom > 100.

    Hope this is of some help.

    (Edit) - I just re-read your post. You're asking about zooming an image on a form, not the image of the form, aren't you? (End-Edit)
    Regards,
    Greg

    Work: XL 2003, 2007 and 2010 on Windows 7
    Please use CODE tags - especially for longer excerpts of code.

  5. #5
    MrExcel MVP
    Int'l Moderator
    Greg Truby's Avatar
    Join Date
    Jun 2002
    Location
    39 17' 15" N, -94 40' 26" W
    Posts
    9,729

    Default Re: Zoom Image on UserForm

    In for a dime, in for a dollar:

    This will resize an image:

    Private Sub CommandButtonGrow_Click()
    ****Dim i As Image
    ****Set i = UserForm1.Image1
    ****i.PictureSizeMode = fmPictureSizeModeZoom
    ****i.Height = i.Height * 1.1
    ****i.Width = i.Width * 1.1
    End Sub

    Private Sub CommandButtonShrink_Click()
    ****Dim i As Image
    ****Set i = UserForm1.Image1
    ****i.PictureSizeMode = fmPictureSizeModeZoom
    ****i.Height = i.Height * 0.9
    ****i.Width = i.Width * 0.9
    End Sub
    Greg

    Work: XL 2003, 2007 and 2010 on Windows 7
    Please use CODE tags - especially for longer excerpts of code.

  6. #6
    Board Regular Todd Bardoni's Avatar
    Join Date
    Aug 2002
    Location
    Rochester, MI USA
    Posts
    3,044

    Default Re: Zoom Image on UserForm

    Thanks. Actually I figured it out. But you did give me the idea of using a scrollbar to adjust the size of the form. Excellent! Thanks!
    Todd


    "I'm a Data Anlyst(intermediate) and have no idea what it's all about."

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com