picturebox image path

matt09524

Freshman
Joined
Sep 14, 2005
Messages
47
In ADO, the path to the database has to be exact be it in varible format or "C:\whatever\whatever.mdb". I was wondering if picture boxes are the same. Do I need to define in code where the image is "application.startuppath" or does the elipses use the app startup path?
 
Visual Basic:
'this should default to the directory the application is in
PictureBox1.Image = New Bitmap("MyBitmap.bmp")

'if it doesn't work use this little function
Public Function AppPath() As String
        Return System.AppDomain.CurrentDomain.BaseDirectory()
End Function
 
If I were you then I would change the .bmp to .png.

Regardless of the image format, you still use the same Bitmap constructor and the behavior is the same.
 
So,

Visual Basic:
mbpic.Image = New Bitmap("mb.png")

should work? I won't knwo for sure until I deploy the app and that won't be for a bit.
 
Back
Top