By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,061 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,061 IT Pros & Developers. It's quick & easy.

trying to put in a default image - help please

P: n/a


With the help of kind, brilliant folks, I have been working on this program
that uses a combo box selection to display six different jpgs. The jps are a
time stamp, and the files are located in six different folders of camera
views. HOWEVER, some of these folders do not have that certain timed jpg.
So...I need to figure out how to show all the rest of the pictures and use
an "no image available or something" for the program to work correctly.

Problem is I don't know how to do this at all.

each folder: Cam 1, Cam 2, Cam 4, Cam 6, Cam 7,and Cam 8 and display each
picture (from selection) from each folder and display in pictureboxes
pcbCam1, pcbCam2, pcbCam4, pcbCam6, pcbCam7, and pcbCam8.

What i need is a default image if there is not file of that same name in one
fo the folders....please help...I am in dire need!

For i As Integer = 1 To 8

Dim pcb As PictureBox = ApplicationControls.FindControl(Me, "pcbCam" & i)

If Not pcb Is Nothing Then

pcb.Image = Image.FromFile(String.Format(folder, i)) <<<<what is this doing
exactly?

End If

Next i
Mar 23 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
AND now I am getting a FileNotFound Exception was unhandled, when I know the
file exists.....:(
pcb.Image = Image.FromFile(String.Format(folder, i)) <<<<stopping
here.....
Please help!
"KitKat" <ki****@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...

With the help of kind, brilliant folks, I have been working on this
program that uses a combo box selection to display six different jpgs. The
jps are a time stamp, and the files are located in six different folders
of camera views. HOWEVER, some of these folders do not have that certain
timed jpg. So...I need to figure out how to show all the rest of the
pictures and use an "no image available or something" for the program to
work correctly.

Problem is I don't know how to do this at all.

each folder: Cam 1, Cam 2, Cam 4, Cam 6, Cam 7,and Cam 8 and display each
picture (from selection) from each folder and display in pictureboxes
pcbCam1, pcbCam2, pcbCam4, pcbCam6, pcbCam7, and pcbCam8.

What i need is a default image if there is not file of that same name in
one fo the folders....please help...I am in dire need!

For i As Integer = 1 To 8

Dim pcb As PictureBox = ApplicationControls.FindControl(Me, "pcbCam" & i)

If Not pcb Is Nothing Then

pcb.Image = Image.FromFile(String.Format(folder, i)) <<<<what is this
doing exactly?

End If

Next i

Mar 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.