Click here to Skip to main content
15,913,758 members
Home / Discussions / C#
   

C#

 
GeneralRe: Java vs .NET - Open Source Pin
DaveyM6916-Mar-09 11:00
professionalDaveyM6916-Mar-09 11:00 
AnswerRe: Java vs .NET - Open Source Pin
led mike16-Mar-09 5:50
led mike16-Mar-09 5:50 
GeneralRe: Java vs .NET - Open Source Pin
Pete O'Hanlon16-Mar-09 5:59
mvePete O'Hanlon16-Mar-09 5:59 
GeneralRe: Java vs .NET - Open Source Pin
led mike16-Mar-09 6:39
led mike16-Mar-09 6:39 
GeneralRe: Java vs .NET - Open Source Pin
dataminers16-Mar-09 6:02
dataminers16-Mar-09 6:02 
GeneralRe: Java vs .NET - Open Source Pin
Pete O'Hanlon16-Mar-09 6:10
mvePete O'Hanlon16-Mar-09 6:10 
AnswerRe: Java vs .NET - Open Source Pin
Mohammad Dayyan16-Mar-09 9:48
Mohammad Dayyan16-Mar-09 9:48 
QuestionDisplaying multiple images in a picturebox crashes after the first one Pin
Sam Shiell16-Mar-09 3:34
Sam Shiell16-Mar-09 3:34 
Hi

I've written a little app that uses FileSystemWatcher to wait for a new *.jpg file to be written to a folder, then loads the image into the picture box.

It works perfectly for the first file, but subsequent files fail with a message about "invalid parameter".

Oddly, this consistantly fails like this EXCEPT when debugging and stepping through the code where it works for about 5 files before it blows up.

This is the relevant code:-

pictureBox1.WaitOnLoad = true; 

Bitmap bmp = new Bitmap(e.FullPath); 

// this is the failing line..... 
pictureBox1.Image = bmp; 


Any ideas? I've tried putting .dispose() statements all over the place but that makes no difference. I've run out of ideas now.

It does seem strange to me that you have to tell it the file is a bitmap when it's actually a jpg file, but I don't know of any other way to "attach" to image file to the control. Could this be what's causing the error?

btw I'm fairly new to C# although I'm a long-term VB6 mug, so this could well be me getting hold of the wrong end of the stick

Cheers

Sam
AnswerRe: Displaying multiple images in a picturebox crashes after the first one Pin
Dave Kreskowiak16-Mar-09 6:04
mveDave Kreskowiak16-Mar-09 6:04 
AnswerRe: Displaying multiple images in a picturebox crashes after the first one Pin
Sam Shiell17-Mar-09 23:30
Sam Shiell17-Mar-09 23:30 
Questionsmall start up application... Pin
geoNeo_16-Mar-09 3:11
geoNeo_16-Mar-09 3:11 
AnswerRe: small start up application... Pin
musefan16-Mar-09 3:26
musefan16-Mar-09 3:26 
GeneralRe: small start up application... Pin
geoNeo_16-Mar-09 3:33
geoNeo_16-Mar-09 3:33 
QuestionColoring ProgressBar Pin
eyalbi00716-Mar-09 3:01
eyalbi00716-Mar-09 3:01 
AnswerRe: Coloring ProgressBar Pin
harold aptroot16-Mar-09 3:11
harold aptroot16-Mar-09 3:11 
GeneralRe: Coloring ProgressBar Pin
musefan16-Mar-09 3:17
musefan16-Mar-09 3:17 
GeneralRe: Coloring ProgressBar Pin
eyalbi00716-Mar-09 3:35
eyalbi00716-Mar-09 3:35 
GeneralRe: Coloring ProgressBar Pin
harold aptroot16-Mar-09 3:40
harold aptroot16-Mar-09 3:40 
GeneralRe: Coloring ProgressBar Pin
eyalbi00716-Mar-09 3:55
eyalbi00716-Mar-09 3:55 
GeneralRe: Coloring ProgressBar Pin
harold aptroot16-Mar-09 3:57
harold aptroot16-Mar-09 3:57 
GeneralRe: Coloring ProgressBar Pin
eyalbi00716-Mar-09 4:48
eyalbi00716-Mar-09 4:48 
GeneralRe: Coloring ProgressBar Pin
harold aptroot16-Mar-09 4:53
harold aptroot16-Mar-09 4:53 
AnswerRe: Coloring ProgressBar Pin
musefan16-Mar-09 3:12
musefan16-Mar-09 3:12 
Answeris not working Pin
Luc Pattyn16-Mar-09 4:19
sitebuilderLuc Pattyn16-Mar-09 4:19 
QuestionAssign Color to text in Rich Textbox Pin
Sajjad Leo16-Mar-09 1:58
Sajjad Leo16-Mar-09 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.