hog Posted July 20, 2005 Posted July 20, 2005 Me.picMain.Image.FromFile(Application.StartupPath & "\photos\" & Me.cboSites.SelectedItem & "\" & Me.cboDates.SelectedItem & "\" & fiFileInfo(0).ToString) When I run this code my picturebox wont display the file? No error occurs in my try/catch and if I messagebox the file path and name used above it appears correct? :confused: Quote My website
Leaders Iceplug Posted July 20, 2005 Leaders Posted July 20, 2005 Image.FromFile() is a shared function, not an instance subroutine. Therefore, you need to assign the result to your image. Me.picMain.Image.FromFile(Application.StartupPath & "\photos\" & Me.cboSites.SelectedItem & "\" & Me.cboDates.SelectedItem & "\" & fiFileInfo(0).ToString) incorrect - this is a function call with out the receipt of the return value. Me.picMain.Image = Image.FromFile(Application.StartupPath & "\photos\" & Me.cboSites.SelectedItem & "\" & Me.cboDates.SelectedItem & "\" & fiFileInfo(0).ToString) (They are conveniently named the same) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
hog Posted July 20, 2005 Author Posted July 20, 2005 Hi, Thnx :) Well I think it works as I believe I can see part of the image, (sky), but it means the source image is way too big for my picture box. Is there a .NET function that resizes an image dynamically to fit pictureboxes? Thnx Quote My website
hog Posted July 20, 2005 Author Posted July 20, 2005 Mmm appears I have been down this road before. Just trolling though old posts I have found ones I stated yonks ago!!! The mind boggles as I did not remember these topics I have covered ages ago, must be my age! Quote My website
Leaders Iceplug Posted July 24, 2005 Leaders Posted July 24, 2005 So, you figured out how to resize your image? I usually just set the PictureBox's SizeMode to Stretch. Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.