This project has moved. For the latest updates, please go here.

Windows 7 Phone Demo Camaer a Does not work.

Jun 19, 2013 at 7:08 PM
Edited Jun 19, 2013 at 7:32 PM
Hi

I deployed the windows 7 phone demo to my lumia 800 running windows phone 7.8 and when I click on the camera button in the demo app. It just exits the demp app and nothing happens.

I hooked up the demo project to a solution then used nuget to get the missing zxing.net .dll and the error seems to be with
  if (timer == null)
         {
            timer = new DispatcherTimer {Interval = TimeSpan.FromMilliseconds(500)};
            if (photoCamera.IsFocusSupported)
            {
               photoCamera.AutoFocusCompleted += (o, arg) => { if (arg.Succeeded) ScanPreviewBuffer(); };
               timer.Tick += (o, arg) => { try { photoCamera.Focus(); } catch (Exception ) { } };
            }
            else
            {
               timer.Tick += (o, arg) => ScanPreviewBuffer();
            }
         }


> System.InvalidOperationException was unhandled
  Message=You cannot use this instance until it is fully initialized. You can initialize by passing this Camera object to VideoBrush.SetSource(...)
  StackTrace:
       at Microsoft.Devices.Camera.InvokeAndRemapExceptions(Action a)
       at Microsoft.Devices.PhotoCamera.get_IsFocusSupported()
       at WindowsPhoneDemo.MainPage.CameraButton_Click(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
  InnerException: System.Runtime.InteropServices.COMException
       Message=0x80590004
       ErrorCode=-2141650940
       StackTrace:
            at Microsoft.Devices.PhotoCamera.<>c__DisplayClass8.<get_IsFocusSupported>b__7()
            at Microsoft.Devices.Camera.InvokeAndRemapExceptions(Action a)
            at Microsoft.Devices.PhotoCamera.get_IsFocusSupported()
            at WindowsPhoneDemo.MainPage.CameraButton_Click(Object sender, RoutedEventArgs e)
            at System.Windows.Controls.Primitives.ButtonBase.OnClick()
            at System.Windows.Controls.Button.OnClick()
            at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
            at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
            at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
Developer
Jun 24, 2013 at 2:34 PM
Hi chobo2,

I did upload you a Very Basic WP7.1 Demo Client on Very Basic WP7.1 Demo Client
Jun 24, 2013 at 4:50 PM
fabianhenzler wrote:
Hi chobo2,

I did upload you a Very Basic WP7.1 Demo Client on Very Basic WP7.1 Demo Client
Cool that seems to work alot better and makes more sense(not all that timer stuff what just confused me).

I am still unclear on a couple things though. How do I set the preview screen bigger do I set it on the brush or the canvas?


What is ShutterKeyHalfPressed for? You have it commented out.