Results 1 to 3 of 3

Thread: Picture problems...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    2

    Lightbulb

    Im working on an install program, and part of the program uses an INI file to get information about the setup (so it can all be customised) but i can workout how to get the data from the ini file into the form.

    I have all the code working for the ini file.
    on open_form goes something like this:

    logo = GetFromINI(all the ini grab code here)
    Picture1.picture = logo

    but it wont do it because it wants the logo to be inside a loadpicture().

    can i bung the logo variable inside the loadpicture() ??

  2. #2
    Guest
    Assuming the logo is just like "C:\Windows\Picture.jpg"...
    Code:
    Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
    
    Public Function ReadINI(strsection As String, strkey As String, strfullpath As String) As String
       Dim strbuffer As String
       Let strbuffer$ = String$(750, Chr$(0&))
       Let ReadINI$ = Left$(strbuffer$, GetPrivateProfileString(strsection$, ByVal LCase$(strkey$), "", strbuffer, Len(strbuffer), strfullpath$))
    End Function
    
    'Hope you know where the logo bmp's root location is stored in cuz I sure don't :p
    'Either try this:
    X = ReadINI("System", "Logo", "C:\Window\System.ini")
    Picture1.Picture = LoadPicture("" & X & "")
    
    'Or this:
    Picture1.Picture = LoadPicture(ReadINI("System.ini", "Logo", "C:\Window\System.ini"))


  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    2

    thanks

    Thanks but i worked it out, it was even easier than that

    X=readINI(get the info)
    picture1.picture= loadpicture(X)

    thats all.
    thanx

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