示例#1
0
        private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
        {
            var width  = Convert.ToInt32(photoCamera.PreviewResolution.Width);
            var height = Convert.ToInt32(photoCamera.PreviewResolution.Height);

            Dispatcher.BeginInvoke(() =>
            {
                previewTransform.Rotation = photoCamera.Orientation;
                // create a luminance source which gets its values directly from the camera
                // the instance is returned directly to the reader
                luminance = new PhotoCameraLuminanceSource(width, height);
                reader    = new BarcodeReader(null, bmp => luminance, null);
            });
        }
示例#2
0
      private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
      {
         var width = Convert.ToInt32(photoCamera.PreviewResolution.Width);
         var height = Convert.ToInt32(photoCamera.PreviewResolution.Height);

         Dispatcher.BeginInvoke(() =>
         {
            previewTransform.Rotation = photoCamera.Orientation;
            // create a luminance source which gets its values directly from the camera
            // the instance is returned directly to the reader
            luminance = new PhotoCameraLuminanceSource(width, height);
            reader = new BarcodeReader(null, bmp => luminance, null);
         });
      }