I am using the Camera’s TakePicture() and StartStreamingBitmaps() methods for displaying and saving images from the camera. When used separately, they work fine. Hoever, if I call StartStreamingBitmaps() after I called TakePicture(), the following exception is thrown:
#### Exception System.Exception - 0xffffffff (1) ####
#### Message:
#### GHIElectronics.NETMF.USBHost.USBH_Webcam::StartStreaming_Internal [IP: 0000] ####
#### GHIElectronics.NETMF.USBHost.USBH_Webcam::StartStreaming [IP: 0005] ####
#### Gadgeteer.Modules.GHIElectronics.Camera::StartStreamingBitmaps [IP: 007e] ####
#### //User code ####
An exception (first chance) of type "System.Exception" has occurred in GHIElectronics.NETMF.USBHost.dll
At this moment, the camera should not be busy, because the event handler of PictureCaptured has already been executed. I do not have a USBHostModule connected to the device. Only a SD card. If StartStreamingBitmaps() is called before the first call to TakePicture(), it succeeds.
After the exception, further calls to TakePicture() will crash, too. The following exception is thrown:
#### Exception System.Exception - 0xffffffff (1) ####
#### Message:
#### GHIElectronics.NETMF.USBHost.USBH_Webcam::StartStreaming_Internal [IP: 0000] ####
#### GHIElectronics.NETMF.USBHost.USBH_Webcam::StartStreaming [IP: 0005] ####
#### Gadgeteer.Modules.GHIElectronics.Camera::TakePicture [IP: 0054] ####
#### //User Code (from timer event) ####
An exception (first chance) of type "System.Exception" has occurred in GHIElectronics.NETMF.USBHost.dll.
Both calls are executed from the same thread (the application’s main thread).
For clarification, here is a sequence of sample calls:
StartStreamingBitmaps - works
StopStreamingBitmaps - works
StartStreamingBitmaps - works
StopStreamingBitmaps - works
TakePicture - works
TakePicture - works
StartStreamingPictures - exception
StopStreamingPictures - works
TakePicture - exception
Is there anything to be paid attention to when using the two methods?
public partial class Program
{
void ProgramStarted()
{
display_T35.WPFWindow.TouchDown += WPFWindow_TouchDown;
}
void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
{
throw new NotImplementedException();
}
}
When i run the code the display became a white background. When i touch one time all things works fine. I use 10 Spider-sets. The problems are on all systems. Allways with the newest Software/Firmware. I think in older Versions of Gadgeteer 4.2/MicroFramework 4.2 there where no problem with touch and camera events.
@ dutzend - Hello. I modified your code slightly so it doesn’t exit with exception after the first touch. Every time the screen is touched I get the expected output “touch event”. Can you explain what behavior you expected from your program and what you see instead?
public partial class Program
{
void ProgramStarted()
{
display_TE35.WPFWindow.TouchDown += WPFWindow_TouchDown;
}
void WPFWindow_TouchDown(object sender, Microsoft.SPOT.Input.TouchEventArgs e)
{
Debug.Print("touch event");
}
}
By the way, this topic should probably be on a separate thread/question in the forum.