Пример #1
0
        //To display sph,cyl and axis values on display area
        private void onRefractionCalculation(String n, Args arg)
        {
            overLay_pbx.Visible = true;
            Forus.Refracto.RefractoReadings reading = arg["readings"] as Forus.Refracto.RefractoReadings;
            if (!Globals.IsR1R2Mode)
            {
                power = "SPH : " + reading.SPH.ToString("0.00") + Environment.NewLine + "CYL : " + reading.CYL.ToString("0.00") + Environment.NewLine + "AXIS : " + reading.AXIS.ToString();
            }
            else
            {
                power = "SPH : " + reading.SPH.ToString("0.00") + Environment.NewLine + "CYL : " + reading.CYL.ToString("0.00") + Environment.NewLine + "AXIS : " + (((reading.AXIS)) % 180).ToString() + Environment.NewLine + "Diff : " + Math.Abs((reading.SPH - reading.CYL)).ToString("0.00");
            };

            Graphics g = Graphics.FromImage(maskOverlay);

            g.FillRectangle(Brushes.Black, new Rectangle(0, 0, maskOverlay.Width, maskOverlay.Height));
            if (reading.IsProperRing)
            {
                g.DrawString(power, new Font("Arial", 24), Brushes.Green, new PointF(0, 50));
            }
            else if (Globals.IsR1R2Mode == false)
            {
                if (!Globals.FileNotFound)
                {
                    g.DrawString(("Retake the image"),
                                 new Font("Arial", 24), Brushes.Red, new PointF((overLay_pbx.Width / 2) - 300, overLay_pbx.Height / 2));
                }
            }
            maskOverlay.MakeTransparent(Color.Black);
            overLay_pbx.Image     = maskOverlay;
            overLay_pbx.BackColor = Color.Transparent;
            overLay_pbx.Refresh();
            g.Dispose();
        }
Пример #2
0
 private void onRefractoCaptureCompleteInLive(String n, Args arg)
 {
     Forus.Refracto.RefractoReadings reading = arg["reading"] as Forus.Refracto.RefractoReadings;
     powerLive = "SPH : " + reading.SPH.ToString("0.00") + Environment.NewLine + "CYL : " + reading.CYL.ToString("0.00") + Environment.NewLine + "AXIS : " + (((reading.AXIS)) % 180).ToString() + Environment.NewLine + "Diff : " + Math.Abs((reading.SPH - reading.CYL)).ToString("0.00");
 }