Results 1 to 2 of 2

Thread: *.jpg*;*.gif*;*.art* viewer

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Fridley, MN, USA
    Posts
    19

    Post

    I am trying to make a picture viewer in which you can click on a file from a file list box (.jpg, .gif, and .art) and have the image displayed on the same form. If you can help i would appreciate it, i am new at this so please try not to be too complicated.
    Thanks

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Try this example..
    Place a Drive List, Dir List and File List Control on a Form, then Add an Image Control, Finally insert the following code:
    Code:
    Private Sub Dir1_Change()
        On Error Resume Next
        File1 = Dir1
    End Sub
    
    Private Sub Drive1_Change()
        On Error Resume Next
        Dir1 = Drive1
    End Sub
    
    Private Sub File1_Click()
        On Error Resume Next
        Image1 = LoadPicture(File1.Path & "\" & File1)
    End Sub
    
    Private Sub Form_Load()
        Image1.Stretch = True
        File1.Pattern = "*.bmp;*.jpg;*.gif;*.ico"
    End Sub
    This will display an Image that is selected from the File List, stretched/shrunk to fit the Imagebox.

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

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