Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

           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:

My website
  • Leaders
Posted

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)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

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

My website
Posted

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!

My website
  • Leaders
Posted

So, you figured out how to resize your image?

I usually just set the PictureBox's SizeMode to Stretch.

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...