Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Finding graphic's paths in VBP (VB6)

    I am working with a VBP that has a few image controls on it. When I click on the Picture property elipse button it opens up a dialog box with a path to the default VB directory but not to the file. Does anyone know how I can find the path to the file used in an image control?

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Finding graphic's paths in VBP (VB6)

    I don't believe that there is any information in your project regarding the original image. When you load a picture with the picture property, VB actually makes a copy of the image in the .frx file associated with the form. -Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding graphic's paths in VBP (VB6)

    There must be something in the image list or form that holds path info for the individual images in the image list, as I found out the hard was this morning.

    I moved a form with an image list on it from one project to another. When I ran the project and opened the form, all the icons in my TreeView Control were solid black.

    Somehow moving the form broke the links to the images. <img src=/S/disappointed.gif border=0 alt=disappointed width=15 height=15> It wouldn't have been a problem if there were only a few, but I had almost 20 icons, with very specific Key values for the individual images. Almost half an hour to get everything reset properly. <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15>

    I don't know how to get the path info, but I'll see if I can spot anything later this afternoon or tonight.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  5. #4
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Finding graphic's paths in VBP (VB6)

    > Somehow moving the form broke the links to the images.
    I sure hope that dosn't happen to my Com AddIn with it's 35 icons in an Image List! <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15> Image lists are fragile, but I don't think that moving the form breaks the links, because there aren't any links. I created a test project with an ImageList, an array of 3 option buttons, and an image control, leaving their default names. I created a folder with three images and placed them in the image list. The only code was the click event:
    <pre>Option Explicit

    Private Sub Option1_Click(Index As Integer)
    Image1.Picture = ImageList1.ListImages(Index + 1).Picture
    End Sub</pre>


    Worked fine. Then, I closed VB & moved/renamed the image and the project folders. I restarted VB & the project ran fine without change. Notice in the image below, the image files are 1 KB each and .frx file is 3 KB.
    Attached Images Attached Images
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  6. #5
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Finding graphic's paths in VBP (VB6)

    Just did a Google search on Visual Basic frx. Looks like there is sometimes a problem if you do a SaveAs in VB with your form file. I heard that VB.NET has gotten rid of the SaveAs. That would be a good thing. Until I had to learn how to do it so that I could teach it, I always messed up SaveAs. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  7. #6
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding graphic's paths in VBP (VB6)

    Ah, maybe that's the difference. I didn't move the frx I just moved the frm. So it looks like actual images may be stored in the frx.

    I just opened up a copy of the frm and this is what is show.

    BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
    Picture = "frmListVars.frx":014A
    Key = "Root"
    EndProperty

    So it looks like the image IS stored in the frx.

    Unfortunately I don't have a copy of my frx readily accessible at the moment, but I will look at it late tonight.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  8. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding graphic's paths in VBP (VB6)

    The frm stores only text. The frx stores any sort of binary info- usually the pictures.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  9. #8
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Finding graphic's paths in VBP (VB6)

    > usually the pictures
    Yes, but lots of non-binary stuff also. Anytime Bill thought that the .frm would be difficult to read, he resorts to an frx. So, even the text from a two line textbox gets stashed in the frx. Also, combo box lists, etc.
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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