Results 1 to 4 of 4

Thread: full path to picture

  1. #1

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    39

    full path to picture

    in a previous post i blamed my app didnt allways showing the pics; now i know why: its because sometimes it cant find the path to the pic;
    i've the relative path in the database's pics field like this:
    fotos6/30.bmp - this folder (fotos6) is in the same directory as my app's one
    If i write the full path:
    c:/my documents/fotos6/30.bmp
    then it allways show the pics;
    my question is: do i really have to write the full path, or is it just a local memory problem, or another bug?
    One last thing: i cant see the pics when i press f5, but if a make an exe from my proj, i can see the pics, though having only the relative path...
    Here's the code i'm using:
    [i have a datagrid and in the DataGrid_RowColChange(bla bla)]
    If Len(Adodc1.Recordset!foto) <> 0 Then
    Picture1.Picture = LoadPicture(Adodc1.Recordset!foto)
    Else
    Picture1.Picture = LoadPicture("r.bmp") [that's the default pic]
    End If

  2. #2
    Member
    Join Date
    May 2002
    Posts
    40

    Re: full path to picture

    Try something like:

    Picture1.Picture = LoadPicture(app.path & "\" & Adodc1.Recordset!foto)
    It's not working? Don't be discouraged. Try a bigger hammer!

  3. #3
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    if you dont supply a directory (full path) then it will seach in the current working directory.

    to make sure it searches in the right place, make a subfolder in your source code directory, and then use App.Path & "\YouSubFolder\file.pic"
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  4. #4

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    39

    pic path

    thanks !
    klori's idea is very adequate because i've several folders to hold the pics
    works great

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