Library tutorials & articles

Making a picture browser in VB 6

Introduction

As, by now you have read some introductory stuff and made some sample working applications too, though quite elementary to be very proud of ;)) and having some knowledge of the concepts working in background to get things done, now its time to do some serious stuff. With serious stuff, I mean something that works somewhat like an application you have already seen and worked with.  

This time, a picture browser’s idea sounds good, as it would not only give you confidence of doing some thing substantial as far as coding with Visual Basic is concerned, at the same time we will see the practical implementation of our working knowledge, using controls and putting some chunks of code to get them inter-related, to work for the purpose.

Comments

  1. 30 Apr 2007 at 11:28

    I am really interested in your project. would you please mail the project  to  me.

    Thanking in anticipation.

    Anand Dutta
    aldutt01@gmail.com
    aldutt01@yahoo.com









  2. 01 Jun 2005 at 11:39

    I am but a newbie to VB but I think you can only do text on dialog boxes.... if it were a picture on the form then I would do it the same as viewing it - only small....

  3. 28 Nov 2004 at 22:13

    I have a few problem with my VB and I'm hoping someone can help me.



    I want to add a Preview in a dlg box when a user is selecting an image.   I have been searching for a code but it's so hard.



    Another question is,  I want to add a form page with 3 panels, 1 on the left side and 2 on the right (1 is above one another).   Can someone help me with that?  

  4. 19 Nov 2003 at 08:37

    Ellos


    i am making a picture view i have a list of file, o n a the F drive i need to change the driver letter?


    i also need to be able to view the pictures?


    Confus ed

  5. 10 May 2003 at 12:49

    i've put up www.combatgold1.co.uk/VB for all my VB projects (with source files) - its not finished yet, but when i have time i'll finish it off

  6. 08 May 2003 at 20:33

    Quote:
    [1]Posted by CombatGold1 on 26 Jul 2002 01:52 PM[/1]
    Look at my program - I've done all you want and more on there. I'll send you the project files if you want?
    I am new to VB, and would certainly like to take a look at how you coded these functions into your image viewer. thanks a whole bunch.

  7. 25 Apr 2003 at 13:06

    You cant call a form image because it's a reserved name.
    VB will think you mean an image and not your form.
    It's recommended to give a form a name which begins with 'frm' and then then name.

  8. 01 Apr 2003 at 19:37

    Hi
    I have carried out this tutorial and it was xtremely helpful.  It worked perfectly on its own.
    When I connected it to a command button on my application using the code
    Private Sub cmdAddLogo_Click()
    Image.Show
    End Sub


    Image being the name I gave to the form


    I got this error runtime error 438 Object doesnt support this property or method


    Can u help with this
    thanx a mil
    Sabrina

  9. 25 Oct 2002 at 15:00

    I am only an amature so i can only give u so much advice............there is a dialog, like the open and save on.....create a button and insert the code to launch the open thingy..........you can fine the code if you create a project with the wizard........it will create the code for you....all you have to do is copy and paste......................................................enjoy!!

  10. 30 Sep 2002 at 03:15

    All my software that is complete is avalible on my home page:
    http://mysite.freeserve.com/CombatGold1/index.html

    Click on the Files tab.

  11. 29 Sep 2002 at 23:15

    If your using FM20 in your Api, only the people who have microsoft office will be able to use it.
    The fm20 dll and ocx familly belong to microsoft and you can't distibute it.


    The only advise that Microsoft give about FM20 is avoid it.


    smartfx

  12. 15 Aug 2002 at 03:47

    im making a picture browser, how can you combine the save and open functions in one form (with different form name?)

  13. 30 Jul 2002 at 03:57

    You will find you might get a problem if you browse your 'net cache - some of the files in there may not be valid image files.


    This often causes vb to hang.

  14. 26 Jul 2002 at 13:52

    Look at my program - I've done all you want and more on there. I'll send you the project files if you want?

  15. 26 Jul 2002 at 08:00

    I've finished my NEW version of Picture Browser.
    Can we send attachments?

  16. 26 Jul 2002 at 07:41

    Finished my second picture browser.  Can we send attachments?

  17. 26 Jul 2002 at 07:30

    I'm making a new version now - It's goinging good so far!

  18. 26 Jul 2002 at 03:25


    but yes... by using the "IMAGE" ctrl you make it use up less resources in your application. the other thing is.. if you ever want to use something as a container... DONT BE the fool that thinks their cool like a tool and use the Picturebox control... use frames without the BorderStyle... pictureboxes are like politicians... the less you have the better!

  19. 26 Jul 2002 at 00:43

    Quote:
    [1]Posted by CombatGold1 on 13 May 2002 12:49 PM[/1]
    [3]
    There is a better control to use!
    There is a better control to use!


    Instead of using a PictureBox, use the "Image" control. Call the image control ' Picture1 ' so you don't have to alter the code you have already put.


    With that you can strecth images to the full size.


    To use a check box to strech the picture, Insert a check box and:
    Give it a name of ' chkStrech '
    Put the caption as ' &Strech image to full size '


    Insert this code:


    Private Sub chkStrech_Click()
    If chkStrech.Value = Checked Then Picture1.Strech = True
    If chkStrech.Value = Unchecked Then Picture1.Strech = False
    End Sub


    [/3]

  20. 21 Jun 2002 at 06:03

    dsdsdsdsd zxzxzx [arial] [/arial]

  21. 06 Jun 2002 at 18:12

    To answer your Question:
    Yes you can restrict file types.
    Add the following to the code secment of the form:


    Private Sub Form_Load()
       File1.Pattern = ".jpg;.bmp;*.gif"
    End Sub


    If you used the image control as suggested set the stretch property to TRUE as suggested and you're done.


    BTW thanks for this little article saved me the time to think about how to create a browser.
    Would be nice is MS would make the browser control available they use for word when inserting a picture, as that is what I was realy after, if anyone knows where to get this control or what the name is drop me a line please.

  22. 13 May 2002 at 13:23

    [2]


    I've done alot now. To see an example of Picture Browser open my home page and click downloads.
    You do not need to be a member of my home page to download this.


    [/2]

  23. 13 May 2002 at 13:04

    [2]
    I've been experimenting and found an even better control!


    If you have it, add a component called ' Microsoft Forms 2.0 '
    Use the Image control from that - you can change the position, zoom and strech. It's wicked!
    Just remember to call it ' Picture1 ' to save time on coding again.
    [/2]

  24. 13 May 2002 at 12:54

    [2]
    There is a better control to use!


    Instead of using a PictureBox, use the "Image" control. Call the image control ' Picture1 ' so you don't have to alter the code you have already put.


    With that you can strecth images to the full size.


    To use a check box to strech the picture, Insert a check box and:
    Give it a name of ' chkStrech '
    Put the caption as ' &Strech image to full size '


    Insert this code:


    Private Sub chkStrech_Click()
    If chkStrech.Value = Checked Then Picture1.Stretch = True
    If chkStrech.Value = Unchecked Then Picture1.Stretch = False
    End Sub


    [2]

  25. 13 May 2002 at 12:49

    [3]
    There is a better control to use!
    There is a better control to use!


    Instead of using a PictureBox, use the "Image" control. Call the image control ' Picture1 ' so you don't have to alter the code you have already put.


    With that you can strecth images to the full size.


    To use a check box to strech the picture, Insert a check box and:
    Give it a name of ' chkStrech '
    Put the caption as ' &Strech image to full size '


    Insert this code:


    Private Sub chkStrech_Click()
    If chkStrech.Value = Checked Then Picture1.Strech = True
    If chkStrech.Value = Unchecked Then Picture1.Strech = False
    End Sub


    [/3]

  26. 11 Apr 2002 at 07:44

    Hi,


    This tutorial is awesome :P


    Is there a way to make that the file viewer shows only pictures (.jpg .gif .bmp...) ?


    And, is there a way to make it show ALL the picture ? ( stretch it to fit the window )


    thanks

  27. 01 Jan 1999 at 00:00

    This thread is for discussions of Making a picture browser in VB 6.

Leave a comment

Sign in or Join us (it's free).