469,625 Members | 1,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

trying to put in a default image - help please



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
1 1171
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.

Similar topics

4 posts views Thread by Mark J. McGinty | last post: by
2 posts views Thread by Michael McGuire | last post: by
25 posts views Thread by Neo Geshel | last post: by
6 posts views Thread by Shimon Sim | last post: by
3 posts views Thread by David Thielen | last post: by
reply views Thread by nickster | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.