Tell me, I want to make a mini game designer, here is what he can do: there is a config.ini file in it, the paths to the pictures are spelled out. Here is an example of such a file.

[Player] Player = D:\test\player.bmp [Chat] ChatBox = D:\test\chatbox.bmp 

The program read these pictures and put them in the ImageBox (and it has the AutoSize = True property AutoSize = True ) ... such a problem, I can not solve. Searched but not found.

    1 answer 1

    Until the end did not understand the question. If you need to load pictures on the basis of the ini file, then the ini-file reading is done by calling the Windows API function

     Private Declare Auto Function GetPrivateProfileString Lib "kernel32" (ByVal AppName As String, _ ByVal KeyName As String, _ ByVal Default As String, _ ByVal ReturnedString As StringBuilder, _ ByVal Size As Integer, _ ByVal FileName As String) As Integer 

    and

     Dim result As Integer Dim buffer As StringBuilder buffer = New StringBuilder(1000) result = GetPrivateProfileString("AppName", "KeyName", "", buffer, buffer.Capacity, pathToIni) 

    and creating a picture from a file

     Dim imageX As Image = Image.FromFile(pathToImage)