public LiveImageControls45_UC()
        {
            InitializeComponent();
            InitializeResourceString();
            maxExposureIndex = Convert.ToInt32(IVLVariables.CurrentSettings.CameraSettings._exposureIndex.val);
            IntucamHelper._updateAnalogvalDigitalVal += IntucamHelper__updateAnalogVal2DigitalVal;
            _liveGainExposure = GainExposureHelper.getInstance();
            if (Screen.PrimaryScreen.Bounds.Width == 1920)
            {
                increaseCaptureGainExposure_btn.Size = decreaseCaptureGainExposure_btn.Size = increaseLiveGainExposure_btn.Size = decreaseLiveGainExposure_btn.Size =
                    liveEG_lbl.Size = captureEG_lbl.Size = new Size(80, 80);
                increaseCaptureGainExposure_btn.Margin = decreaseCaptureGainExposure_btn.Margin = increaseLiveGainExposure_btn.Margin = decreaseLiveGainExposure_btn.Margin =
                    liveEG_lbl.Margin = captureEG_lbl.Margin = new Padding(10, 1, 0, 2);
            }
            else if (Screen.PrimaryScreen.Bounds.Width == 1366)
            {
                increaseCaptureGainExposure_btn.Size = decreaseCaptureGainExposure_btn.Size = increaseLiveGainExposure_btn.Size = decreaseLiveGainExposure_btn.Size =
                    liveEG_lbl.Size = captureEG_lbl.Size = new Size(60, 60);
                //increaseCaptureGainExposure_btn.Margin = decreaseCaptureGainExposure_btn.Margin = increaseLiveGainExposure_btn.Margin = decreaseLiveGainExposure_btn.Margin =
                //       liveEG_lbl.Margin = captureEG_lbl.Margin = new Padding(10, 1, 0, 2);
            }
            else if (Screen.PrimaryScreen.Bounds.Width == 1280)
            {
                increaseCaptureGainExposure_btn.Size = decreaseCaptureGainExposure_btn.Size = increaseLiveGainExposure_btn.Size = decreaseLiveGainExposure_btn.Size =
                    liveEG_lbl.Size = captureEG_lbl.Size = new Size(60, 60);
            }
            //toolStrip1.Renderer = new Custom.Controls.FormToolStripRenderer();
            //toolStrip2.Renderer = new Custom.Controls.FormToolStripRenderer();


            this.Resize      += LiveImageControls45_UC_Resize;
            this.SizeChanged += LiveImageControls45_UC_SizeChanged;
        }
 public static GainExposureHelper getInstance()
 {
     if (gainExposureHelper == null)
     {
         gainExposureHelper = new GainExposureHelper();
     }
     return(gainExposureHelper);
 }
예제 #3
0
        public LiveImageControlsPrime_UC()
        {
            InitializeComponent();
            InitializeResourceString();
            _liveGainExp = GainExposureHelper.getInstance();

            //toolStrip1.Renderer = new Custom.Controls.FormToolStripRenderer();

            string highIntLogoFilePath = @"ImageResources\IntensityImageResources\High_Light.png";
            string LowIntLogoFilePath  = @"ImageResources\IntensityImageResources\Low_Light.png";
            string MedIntLogoFilePath  = @"ImageResources\IntensityImageResources\Med_Light.png";

            if (File.Exists(highIntLogoFilePath))
            {
                Bitmap bm = new Bitmap(highIntLogoFilePath); // Bitmap bm has been added so as to reduce the time of new bitmapping everytime
                highFlashGain_btn.Image = bm;                //, 256, 256);
                highLiveGain_btn.Image  = bm;                //, 256, 256);
            }
            if (File.Exists(MedIntLogoFilePath))
            {
                Bitmap bm = new Bitmap(MedIntLogoFilePath); // Bitmap bm has been added so as to reduce the time of new bitmapping everytime
                mediumFlashGain_btn.Image = bm;             //, 256, 256);
                mediumLiveGain_btn.Image  = bm;             //, 256, 256);
            }
            if (File.Exists(LowIntLogoFilePath))
            {
                Bitmap bm = new Bitmap(LowIntLogoFilePath); // Bitmap bm has been added so as to reduce the time of new bitmapping everytime
                LowFlashGain_btn.Image = bm;                ///, 256, 256);
                lowLiveGain_btn.Image  = bm;                //, 256, 256);
            }
            if (Screen.PrimaryScreen.Bounds.Width == 1920)
            {
                lowLiveGain_btn.Size           = mediumLiveGain_btn.Size = highLiveGain_btn.Size = LowFlashGain_btn.Size =
                    mediumFlashGain_btn.Size   = highFlashGain_btn.Size = new Size(80, 80);
                lowLiveGain_btn.Margin         = mediumLiveGain_btn.Margin = highLiveGain_btn.Margin = LowFlashGain_btn.Margin =
                    mediumFlashGain_btn.Margin = highFlashGain_btn.Margin = new Padding(10, 1, 0, 2);
            }
            else if (Screen.PrimaryScreen.Bounds.Width == 1366)
            {
                lowLiveGain_btn.Size         = mediumLiveGain_btn.Size = highLiveGain_btn.Size = LowFlashGain_btn.Size =
                    mediumFlashGain_btn.Size = highFlashGain_btn.Size = new Size(60, 60);// The size has been changed to 60, 60 from 150,80 by sriram
                //lowLiveGain_btn.Margin = mediumLiveGain_btn.Margin = highLiveGain_btn.Margin = LowFlashGain_btn.Margin =
                //    mediumFlashGain_btn.Margin = highFlashGain_btn.Margin = new Padding(10, 1, 0, 2);
                //increaseCaptureGainExposure_btn.Size = decreaseCaptureGainExposure_btn.Size = increaseLiveGainExposure_btn.Size = decreaseLiveGainExposure_btn.Size =
                //   liveEG_lbl.Size = captureEG_lbl.Size = new Size(150, 80);
                //increaseCaptureGainExposure_btn.Margin = decreaseCaptureGainExposure_btn.Margin = increaseLiveGainExposure_btn.Margin = decreaseLiveGainExposure_btn.Margin =
                //       liveEG_lbl.Margin = captureEG_lbl.Margin = new Padding(10, 1, 0, 2);
            }
            else if (Screen.PrimaryScreen.Bounds.Width == 1280)
            {
                lowLiveGain_btn.Size         = mediumLiveGain_btn.Size = highLiveGain_btn.Size = LowFlashGain_btn.Size =
                    mediumFlashGain_btn.Size = highFlashGain_btn.Size = new Size(60, 60);
                //increaseCaptureGainExposure_btn.Size = decreaseCaptureGainExposure_btn.Size = increaseLiveGainExposure_btn.Size = decreaseLiveGainExposure_btn.Size =
                //   liveEG_lbl.Size = captureEG_lbl.Size = new Size(60, 60);
            }

            //// This has been added to fix the defect of live gain to 77 by default by sriram this avoids the gain setting to 77
            //if (IVLVariables.ivl_Camera.ImagingMode == ImagingMode.Anterior_Prime ) // changed the condition from and to or by sriram to handle both prime and anterior
            //{


            //    IVLVariables.CurrentLiveGain = (GainLevels)Enum.Parse(typeof(GainLevels), IVLVariables.CurrentSettings.CameraSettings._LiveGainDefault.val); // get default values from settings for live
            //    IVLVariables.CurrentCaptureGain = (GainLevels)Enum.Parse(typeof(GainLevels), IVLVariables.CurrentSettings.CameraSettings._DigitalGainDefault.val);// get default values from setting for capture by sriram
            //    RefreshFlashGainButtons(IVLVariables.CurrentLiveGain);
            //    RefreshLiveGainButtons( IVLVariables.CurrentCaptureGain);
            //}
            //else if( IVLVariables.ivl_Camera.ImagingMode == ImagingMode.Posterior_Prime)
            //{
            //    IVLVariables.CurrentLiveGain = (GainLevels)Enum.Parse(typeof(GainLevels), IVLVariables.CurrentSettings.CameraSettings._LiveGainDefault.val); // get default values from settings for live
            //    IVLVariables.CurrentCaptureGain = (GainLevels)Enum.Parse(typeof(GainLevels), IVLVariables.CurrentSettings.CameraSettings._DigitalGainDefault.val);// get default values from setting for capture by sriram
            //    RefreshFlashGainButtons(IVLVariables.CurrentLiveGain);
            //    RefreshLiveGainButtons(IVLVariables.CurrentCaptureGain);
            //}
        }