Null Reference Exception was unhandled
I've an application to capture video of image as well as grab still image. ItÂ¡Â¦s running well. Then, I put loop in the code so the application could keep capturing the image repeatedly and automatically. However it gives one exception error:
NullReferenceException was unhandled âÂ³ Â¡Â¨Object reference not set to an instance of an object".
I found that, this error emerged when I called image from the folder. The reason of my assumption is because when I put comment notation before that line code, the application could run well.
These are the code that call image file from the folder outside of the main body of code programming.
//load an image for subtract
System.Drawing.Bitmap image2 = (Bitmap)Bitmap.FromFile("plane.Jpeg");
//// apply filter subtract===>>>> call file from out bin folder <<<<=====
System.Drawing.Bitmap subtract = filter1.Apply(image2);
However, when I run the code, the error refer to this code:
catch (Exception ex)
For your information, my application not uses any web server for the application. Any body can help me please..