Esempio n. 1
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            closeScanner = false;
            isPage       = true;
            if (param_Orientation == SupportedPageOrientation.Landscape)
            {
                this.Dispatcher.BeginInvoke((Action)(() =>
                {
                    this.SupportedOrientations = SupportedPageOrientation.Landscape;
                }));
            }
            else
            if (param_Orientation == SupportedPageOrientation.Portrait)
            {
                this.Dispatcher.BeginInvoke((Action)(() =>
                {
                    this.SupportedOrientations = SupportedPageOrientation.Portrait;
                }));
            }


            if (CPU_CORES <= 0)
            {
                CPU_CORES = BarcodeHelper.getCPUCores();
            }
            if (param_maxThreads > CPU_CORES)
            {
                param_maxThreads = CPU_CORES;
            }

            InitializeCamera(CameraSensorLocation.Back);

            isProcessing    = false;
            resultDisplayed = false;
            isClosing       = false;
            fixOrientation(Orientation);
            if ((param_OverlayMode & OverlayMode.OM_MW) > 0)
            {
                MWOverlay.addOverlay(canvas);
            }



            if ((param_OverlayMode & OverlayMode.OM_IMAGE) > 0)
            {
                cameraOverlay.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                cameraOverlay.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
 public int getAvailableCores()
 {
     return(BarcodeHelper.getCPUCores());
 }