Results 1 to 6 of 6

Thread: [RESOLVED] Resize image proportionally?

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2005
    Posts
    33

    Resolved [RESOLVED] Resize image proportionally?

    hi

    I have the following simple form which allows the user to select and view an image. However currently all images are set to stretch to fit the space given. I want to be able to resize the image in proportion to fit inside the space.

    Any help would be great.

    Here's the code:

    Code:
    Private Sub Dir1_Change()
        File1.Path = Dir1.Path        'Update files.
    End Sub
    
    Private Sub Drive1_Change()
        Dir1.Path = Drive1.Drive      'Update directory path.
    End Sub
    
    Private Sub File1_Click()
        If Right(File1.Path, 1) <> "\" Then
            Label1.Caption = File1.Path & "\" & File1.FileName
        Else                          'If root directory
            Label1.Caption = File1.Path & File1.FileName
        End If
        frmPhoto.Open.Picture = LoadPicture(Label1.Caption)
    End Sub
    
    Private Sub cmdSave_Click()
        If Right(File1.Path, 1) <> "\" Then
            pic = File1.Path & "\" & File1.FileName
        Else                          'If root directory
            pic = File1.Path & File1.FileName
        End If
        frmEmployee.txtPhoto.Text = pic
        
        '-----Add notice to lblNotice on frmMain
            
        frmMain.lblNotice.Caption = ""
        frmMain.lblNotice.Caption = "Photo Added"
        
        Unload Me
    End Sub
    edit: vbcode tags not working for some reason

    ... and the form:
    Attached Images Attached Images  
    Last edited by Pino; Jul 22nd, 2005 at 06:55 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width