Hi , I am trying to save an image captured by camera using following code :
void camera_PictureCaptured(GTM.GHIElectronics.Camera sender, GT.Picture picture)
{
canvasCamera.Children.Remove(cameraImage);
canvasCamera.UpdateLayout();
cameraImage = new Image(picture.MakeBitmap());
cameraImage.Width = 100;
cameraImage.Height = 100;
canvasCamera.Children.Add(cameraImage);
Canvas.SetTop(cameraImage, 70);
Canvas.SetLeft(cameraImage, 30);
writeFile(@ "\TESTFILE.bmp", cameraImage.Bitmap.GetBitmap());
}
private static void writeFile(string path, byte[] data)
{
// Create a file stream object
FileStream fHandle = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
// Write the contents
fHandle.Write(data, 0, data.Length);
// We're done.
fHandle.Close();
}
but I get the following error :
The thread '<No Name>' (0x3) has exited with code 0 (0x0).
#### Exception System.IO.IOException - CLR_E_VOLUME_NOT_FOUND (1) ####
#### Message:
#### System.IO.Path::NormalizePath [IP: 0070] ####
#### System.IO.Path::GetFullPath [IP: 001a] ####
#### System.IO.FileStream::.ctor [IP: 0009] ####
#### System.IO.FileStream::.ctor [IP: 0009] ####
#### AllControls.Program::writeFile [IP: 0007] ####
#### AllControls.Program::camera_PictureCaptured [IP: 006a] ####
#### Gadgeteer.Modules.GHIElectronics.Camera::OnPictureCapturedEvent [IP: 0037] ####
#### System.Reflection.MethodBase::Invoke [IP: 0000] ####
#### Gadgeteer.Program::DoOperation [IP: 001a] ####
#### Microsoft.SPOT.Dispatcher::PushFrameImpl [IP: 0054] ####
#### Microsoft.SPOT.Dispatcher::PushFrame [IP: 001a] ####
#### Microsoft.SPOT.Dispatcher::Run [IP: 0006] ####
#### Gadgeteer.Program::Run [IP: 0020] ####
A first chance exception of type 'System.IO.IOException' occurred in System.IO.dll
Error invoking method "Gadgeteer.Modules.GHIElectronics.Camera" (check arguments to Program.BeginInvoke are correct)