public ReportImages(Dictionary <string, object> reportData) { InitializeComponent(); _dataModel = DataModel.GetInstance(); //This Icon has been added by darshan on 13-08-2015 to resolve defect no 0000554: Report icon to be changed as in the Logo of Intuvision. string appLogoFilePath = @"ImageResources\LogoImageResources\ReportLogo.ico"; if (File.Exists(appLogoFilePath)) { this.Icon = new System.Drawing.Icon(appLogoFilePath, 256, 256); } if (!string.IsNullOrEmpty(reportImageText)) { this.Text = reportImageText; } if (!string.IsNullOrEmpty(reportImageSizeText)) { Trackbar_lbl.Text = reportImageSizeText; } if (!string.IsNullOrEmpty(reportImageOkbtnText)) { button1.Text = reportImageOkbtnText; } if (reportData.ContainsKey("Color1")) { this.Color1 = (Color)reportData["Color1"]; } if (reportData.ContainsKey("Color2")) { this.Color2 = (Color)reportData["Color2"]; } if (reportData.ContainsKey("ForeColor")) { this.ForeColor = (Color)reportData["ForeColor"]; } if (reportData.ContainsKey("ColorAngle")) { this.ColorAngle = (float)reportData["ColorAngle"]; } this.button1.ForeColor = Color.Black; this.button1.BackColor = Color.Transparent; _eventhandler = IVLEventHandler.getInstance(); _eventhandler.Register(_eventhandler.ReportImagesIsShiftControl, new NotificationHandler(reportImagesIsShiftControl)); }
/// <summary> /// Constructor for the sample application /// </summary> public CameraApiSampleWindow() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; IVL_CAM = IntucamHelper.GetInstance(); // Get IVL camera object IVL_CAM.Pbx = display_pbx; eventHandler = IVLEventHandler.getInstance(); // Get IVL event handler Object //eventHandler.Register(eventHandler.DisplayImage, new NotificationHandler(DisplayImage)); //eventHandler.Register(eventHandler.DisplayCapturedImage, new NotificationHandler(DisplayCapturedImage)); eventHandler.Register(eventHandler.RotaryMovedEvent, new NotificationHandler(RotaryDisplayDiaptor)); eventHandler.Register(eventHandler.UPDATE_POWER_STATUS, new NotificationHandler(ShowPowerConnection)); eventHandler.Register(eventHandler.UPDATE_CAMERA_STATUS, new NotificationHandler(ShowCameraConnection)); eventHandler.Register(eventHandler.FrameRateStatusUpdate, new NotificationHandler(FrameStatusUpdater)); eventHandler.Register(eventHandler.ChangeLeftRightPos_Live, new NotificationHandler(ChangeLeftRightPosition)); eventHandler.Register(eventHandler.FrameCaptured, new NotificationHandler(FrameCaptured)); IVL_CAM._EnableControls += EnableDisableControls; ListOfControls = GetControls(this).ToList(); EnableDisableControls(false); }
private Imaging_UC() { InitializeComponent(); eventHandler = IVLEventHandler.getInstance(); eventHandler.Register(eventHandler.SetImagingScreen, new NotificationHandler(SetLiveRViewMode)); eventHandler.Register(eventHandler.HideSplash, new NotificationHandler(closeSplash)); eventHandler.Register(eventHandler.EnableZoomMagnification, new NotificationHandler(enableZoomMag)); eventHandler.Register(eventHandler.ChangedDisplayBitmap, new NotificationHandler(ChangedImage)); //eventHandler.Register(eventHandler.PosteriorAnteriorSelection, new NotificationHandler(SetOverlay)); eventHandler.Register(eventHandler.FrameRateStatusUpdate, new NotificationHandler(camera_statusBarUpdate)); eventHandler.Register(eventHandler.RotaryMovedEvent, new NotificationHandler(RotaryMovemetDone)); eventHandler.Register(eventHandler.DisplayImage, new NotificationHandler(DisplayImageFromCamera)); eventHandler.Register(eventHandler.DisplayCapturedImage, new NotificationHandler(DisplayCapturedImage)); eventHandler.Register(eventHandler.UpdateOverlay, new NotificationHandler(updateOverlay)); toolStrip1.Visible = false; liveImagingControl = new LiveImageControls_UC(); viewImagingControl = new ViewImageControls_UC(); liveImagingControl.Dock = DockStyle.Fill; viewImagingControl.Dock = DockStyle.Fill; m_DelegateSetLiveOrView = new DelegateSetLiveOrView(this.SetLiveRViewMode); m_DelegateSetView = new DelegateSetView(this.setViewScreen); IVLVariables.ivl_Camera.camPropsHelper.resetBitmapRight = new Bitmap(negativeDiaptor_pbx.ClientSize.Width, negativeDiaptor_pbx.ClientSize.Height); IVLVariables.ivl_Camera.camPropsHelper.negativearrowSymbol = new Bitmap(negativeDiaptor_pbx.ClientSize.Width, negativeDiaptor_pbx.ClientSize.Height); IVLVariables.ivl_Camera.camPropsHelper.positivearrowSymbol = new Bitmap(negativeDiaptor_pbx.ClientSize.Width, negativeDiaptor_pbx.ClientSize.Height); IVLVariables.ivl_Camera.camPropsHelper.LeftBitmap = new Bitmap(neg_pbx.ClientSize.Width, neg_pbx.ClientSize.Height); // Added this to manage the blinking happening in the UI to show the sensor position when the rotary is moved instead of using the panel drawing IVLVariables.ivl_Camera.camPropsHelper.RightBitmap = new Bitmap(pos_pbx.ClientSize.Width, pos_pbx.ClientSize.Height); // Added this to manage the blinking happening in the UI to show the sensor position when the rotary is moved instead of using the panel drawing viewImagingControl.noImageSelected_lbl = this.NoImageSelected_lbl; //IVLVariables.ivl_Camera.camPropsHelper.RBwidth = pos_pbx.Width; //IVLVariables.ivl_Camera.camPropsHelper.RBheight = pos_pbx.Height; //IVLVariables.ivl_Camera.camPropsHelper.LBwidth = neg_pbx.Width; //IVLVariables.ivl_Camera.camPropsHelper.LBheight = neg_pbx.Height; MinResumeCount = 0; count = 10; //focus_lbl.Text = IVLVariables.LangResourceManager.GetString( "MotorFocus_Text",IVLVariables.LangResourceCultureInfo); #region added block of code for drawing negative and positive symbol and overlays. negativeSymbol = new Bitmap(32, 32); positiveSymbol = new Bitmap(32, 32); //solidBrush = new SolidBrush(Color.FromName(IVLVariables.CurrentSettings.CameraSettings._MotorNegativeColor.val)); solidBrush = new SolidBrush(Color.White); float diaptorFontSize = 14.0f; float diatptorFontYAxis = 4.5f; float diaptorLineSize = 3f; Graphics g = Graphics.FromImage(negativeSymbol); g.FillRectangle(Brushes.Black, new Rectangle(0, 0, negativeSymbol.Width, negativeSymbol.Height)); //g.DrawLine(new Pen(Brushes.Aqua, 2f), new Point(negativeSymbol.Width / 2, 2), new Point(negativeSymbol.Width / 2, negativeSymbol.Height - 2)); g.DrawLine(new Pen(solidBrush, diaptorLineSize), new Point(2, negativeSymbol.Height / 2), new Point((negativeSymbol.Width / 2) - 1, negativeSymbol.Height / 2)); g.DrawString("D", new System.Drawing.Font(new System.Drawing.FontFamily("Times New Roman"), diaptorFontSize), solidBrush, new PointF((float)(negativeSymbol.Width / 2) - 1, diatptorFontYAxis)); //negativeSymbol.Save("Negative.bmp"); g = Graphics.FromImage(positiveSymbol); //solidBrush = new SolidBrush(Color.FromName(IVLVariables.CurrentSettings.CameraSettings._MotorPositiveColor.val)); solidBrush = new SolidBrush(Color.White); g.FillRectangle(Brushes.Black, new Rectangle(0, 0, positiveSymbol.Width, positiveSymbol.Height)); g.DrawLine(new Pen(solidBrush, diaptorLineSize), new Point(positiveSymbol.Width / 4, positiveSymbol.Height / 4 + 1), new Point(positiveSymbol.Width / 4, (positiveSymbol.Height / 2) + positiveSymbol.Height / 4 - 1)); //vertical line for the plus symbol to show rotary movement g.DrawLine(new Pen(solidBrush, 3f), new Point(2, positiveSymbol.Height / 2), new Point((int)((float)(positiveSymbol.Width / 2) - 1f), positiveSymbol.Height / 2)); // horizontal line for the plus symbol to show rotary movement g.DrawString("D", new System.Drawing.Font(new System.Drawing.FontFamily("Times New Roman"), diaptorFontSize), solidBrush, new PointF((float)(positiveSymbol.Width / 2) - 1, diatptorFontYAxis)); // D to show diaptor in rotary movement //This code has been modified by Darshan on 24-08-2015 to solve Defect no 0000567: The OD and OS sections are masked. #endregion display_pbx.MouseWheel += display_pbx_MouseWheel; Rectangle screenRectangle = RectangleToScreen(this.ClientRectangle); //titleBarHeight = screenRectangle.Top - this.Top; leftBorderWidth = screenRectangle.Left - base.Left; rightBorderWidth = base.Right - screenRectangle.Right; topBorderHeight = screenRectangle.Top - base.Top; bottomBorderHeight = base.Bottom - screenRectangle.Bottom; overlay_pbx.Visible = false; negativeSymbol = new Bitmap(32, 32); positiveSymbol = new Bitmap(32, 32); //IVLVariables.ivl_Camera.camPropsHelper.RotaryNegativeColor = IVLVariables.CurrentSettings.CameraSettings._MotorNegativeColor.val; IVLVariables.ivl_Camera.camPropsHelper.RotaryNegativeColor = "White"; //solidBrush = new SolidBrush(Color.FromName(IVLVariables.CurrentSettings.CameraSettings._MotorNegativeColor.val)); solidBrush = new SolidBrush(Color.White); g = Graphics.FromImage(negativeSymbol); g.FillRectangle(Brushes.Transparent, new Rectangle(0, 0, negativeSymbol.Width, negativeSymbol.Height)); //g.DrawLine(new Pen(Brushes.Aqua, 2f), new Point(negativeSymbol.Width / 2, 2), new Point(negativeSymbol.Width / 2, negativeSymbol.Height - 2)); g.DrawLine(new Pen(solidBrush, diaptorLineSize), new Point(2, negativeSymbol.Height / 2), new Point((negativeSymbol.Width / 2) - 1, negativeSymbol.Height / 2)); g.DrawString("D", new System.Drawing.Font(new System.Drawing.FontFamily("Times New Roman"), diaptorFontSize), solidBrush, new PointF((float)(negativeSymbol.Width / 2) - 1, diatptorFontYAxis)); g = Graphics.FromImage(positiveSymbol); //IVLVariables.ivl_Camera.camPropsHelper.RotaryPositiveColor = IVLVariables.CurrentSettings.CameraSettings._MotorPositiveColor.val; IVLVariables.ivl_Camera.camPropsHelper.RotaryPositiveColor = "White"; //solidBrush = new SolidBrush(Color.FromName(IVLVariables.CurrentSettings.CameraSettings._MotorPositiveColor.val)); solidBrush = new SolidBrush(Color.White); g.FillRectangle(Brushes.Transparent, new Rectangle(0, 0, positiveSymbol.Width, positiveSymbol.Height)); g.DrawLine(new Pen(solidBrush, diaptorLineSize), new Point(positiveSymbol.Width / 4, positiveSymbol.Height / 4 + 1), new Point(positiveSymbol.Width / 4, (positiveSymbol.Height / 2) + positiveSymbol.Height / 4 - 1)); //vertical line for the plus symbol to show rotary movement g.DrawLine(new Pen(solidBrush, 3f), new Point(2, positiveSymbol.Height / 2), new Point((int)((float)(positiveSymbol.Width / 2) - 1f), positiveSymbol.Height / 2)); // horizontal line for the plus symbol to show rotary movement g.DrawString("D", new System.Drawing.Font(new System.Drawing.FontFamily("Times New Roman"), diaptorFontSize), solidBrush, new PointF((float)(positiveSymbol.Width / 2) - 1, diatptorFontYAxis)); // D to show diaptor in rotary movement negativeDiaptor_pbx.Image = negativeSymbol; positiveDiaptor_pbx.Image = positiveSymbol; IVLVariables.ivl_Camera.camPropsHelper.CreatePositiveNegativeDiaptorSymbols(); toolStrip1.Renderer = new INTUSOFT.Custom.Controls.FormToolStripRenderer(); IVLVariables.ivl_Camera.Pbx = (PictureBox)display_pbx; IVLVariables.ivl_Camera.MaskOverlayPbx = (PictureBox)maskOverlay_Pbx; IVLVariables.ivl_Camera.LeftDiaptorPbx = neg_pbx; IVLVariables.ivl_Camera.RightDiaptorPbx = pos_pbx; IVLVariables.ivl_Camera.LeftArrowPbx = negativeArrow_pbx; IVLVariables.ivl_Camera.RightArrowPbx = positiveArrow_pbx; #region Label Texts for Camera status bar IVLVariables.ivl_Camera.FrameRateLabelText = IVLVariables.LangResourceManager.GetString("FrameRate_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.CameraConnectionLabelText = IVLVariables.LangResourceManager.GetString("Camera_Text", IVLVariables.LangResourceCultureInfo) + IVLVariables.LangResourceManager.GetString("Connected_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.CameraDisconnectionLabelText = IVLVariables.LangResourceManager.GetString("Camera_Text", IVLVariables.LangResourceCultureInfo) + IVLVariables.LangResourceManager.GetString("Disconnected_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.LiveExposureLabelText = IVLVariables.LangResourceManager.GetString("IR_Intensity_Label_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.LiveGainLabelText = IVLVariables.LangResourceManager.GetString("LiveGain_Label_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.CaptureExposureLabelText = IVLVariables.LangResourceManager.GetString("Flash_Intesnity_Label_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.CaptureGainLabelText = IVLVariables.LangResourceManager.GetString("gain_Label_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.ComportOpenLabelText = IVLVariables.LangResourceManager.GetString("Comport_Text", IVLVariables.LangResourceCultureInfo) + IVLVariables.LangResourceManager.GetString("Open_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.ComportCloseLabelText = IVLVariables.LangResourceManager.GetString("Comport_Text", IVLVariables.LangResourceCultureInfo) + IVLVariables.LangResourceManager.GetString("Closed_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.PowerOnLabelText = IVLVariables.LangResourceManager.GetString("Power_Text", IVLVariables.LangResourceCultureInfo) + IVLVariables.LangResourceManager.GetString("On_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.PowerOffLabelText = IVLVariables.LangResourceManager.GetString("Power_Text", IVLVariables.LangResourceCultureInfo) + IVLVariables.LangResourceManager.GetString("Off_Text", IVLVariables.LangResourceCultureInfo); IVLVariables.ivl_Camera.FrameRate_lbl = this.FrameRate_lbl; IVLVariables.ivl_Camera.ExposureStatus_lbl = this.ExposureStatus_lbl; IVLVariables.ivl_Camera.gainStatus_lbl = this.gainStatus_lbl; #endregion }