Hi all,
I am having a little problem with a custom camera page I am having to develop in ArcGIS for Windows Mobile. The reason for custom camera page is, out of the box ArcGIS for Windows Mobile 10.1.1 does not provide user with option to chage camera resolution settings.
In the code I am using following lines;
ESRI.ArcGIS.Mobile.Client.WebCam.CameraService.DefaultCamera.CaptureHeight = 768;
ESRI.ArcGIS.Mobile.Client.WebCam.CameraService.DefaultCamera.CaptureWidth = 1024;
System.Drawing.Bitmap image = ESRI.ArcGIS.Mobile.Client.WebCam.CameraService.DefaultCamera.GetCurrentImage();
image.Save(System.IO.Path.GetTempFileName(), image.RawFormat);
However, the code above falls over with MemoryAccessViolation, a very low level error. Even Try Catch does not seem to capture it. In debug mode, error sometimes happens at GetCurrentImage, sometimes at image.Save and sometimes after.
I have tried all sorts of things, such as cloning Bitmap, saving it MemoryStream first and then saving to FileStream, adding Thread.Sleep, boxing the disposable objects with "using" etc. But one of the calls that involve Bitmap or Stream objects, falls over with AccessViolation. Any idea why this is happening.
Out of the box Camera button works fine and I can see JPG created in %TEMP% folder as well as attachment added. Just they are very low resolution images.
Any help is much appreciated. My project goes live in two weeks time.
Cheers,
Vish
PS: Someone else had started a similar thread but no answer was provided.