コード例 #1
0
 public void Dispose()
 {
     BorderLeft.Dispose();
     BorderRight.Dispose();
     BorderTop.Dispose();
     BorderBottom.Dispose();
 }
コード例 #2
0
 private void target_Shown(object sender, EventArgs e)
 {
     BorderLeft.Show();
     BorderRight.Show();
     BorderTop.Show();
     BorderBottom.Show();
     UpdateBorders();
 }
コード例 #3
0
 public void Update(object args)
 {
     if (!Form.InDesignMode())
     {
         if (BorderLeft != null)
         {
             BorderLeft.Update(args);
             BorderTop.Update(args);
             BorderRight.Update(args);
             BorderBottom.Update(args);
         }
     }
 }
コード例 #4
0
        public void Test(List <WriteableBitmap> bList)
        {
            if (bList == null || bList.Count == 0)
            {
                return;
            }
            var b = bList.FirstOrDefault();

            sb = WriteableBitmapHelper.Clone(b);
            if (!IsLeft)
            {
                b = isoc.FlipYImage(b);
            }

            lChartPhoto1.Photo = (b);
            try
            {
                long l = isoc.getResoveLines(sb, 0.735f, IsLeft);
                if (IsLeft)
                {
                    textBlockIsLeft.Text = "左";
                }
                else
                {
                    textBlockIsLeft.Text = "右";
                }

                testResult.Text = l.ToString() + "LP";

                BorderLeft  = Convert.ToDouble(isoc.ptp.ProcessInfor["RayleiResolutionLeftBorder"]);
                BorderRight = Convert.ToDouble(isoc.ptp.ProcessInfor["RayleiResolutionRightBorder"]);
                double p = Convert.ToDouble(isoc.ptp.ProcessInfor["RayleiResolutionRightPosition"]);



                string st = isoc.ptp.ProcessInfor["ISOCardType"].ToString();
                if (st == "100-600")
                {
                    comboBox1.SelectedIndex = 2;
                }
                if (st == "500-2000")
                {
                    comboBox1.SelectedIndex = 0;
                }
                if (st == "1000-4000")
                {
                    comboBox1.SelectedIndex = 1;
                }

                leftBorder.Text  = BorderLeft.ToString();
                rightBorder.Text = BorderRight.ToString();
                RayleP.Text      = p.ToString();

                ll.Y1 = 0;
                ll.Y2 = lChartPhoto1.Height;
                ll.X1 = BorderLeft / b.PixelWidth * lChartPhoto1.Width;
                ll.X2 = ll.X1;
                if (!lChartPhoto1.getDrawObjectCanvas().Children.Contains(ll))
                {
                    lChartPhoto1.getDrawObjectCanvas().Children.Add(ll);
                }

                rl.Y1 = 0;
                rl.Y2 = lChartPhoto1.Height;
                rl.X1 = BorderRight / b.PixelWidth * lChartPhoto1.Width;
                rl.X2 = rl.X1;
                if (!lChartPhoto1.getDrawObjectCanvas().Children.Contains(rl))
                {
                    lChartPhoto1.getDrawObjectCanvas().Children.Add(rl);
                }

                pl.Y1 = 0;
                pl.Y2 = lChartPhoto1.Height;
                pl.X1 = p / b.PixelWidth * lChartPhoto1.Width;
                pl.X2 = pl.X1;
                if (!lChartPhoto1.getDrawObjectCanvas().Children.Contains(pl))
                {
                    lChartPhoto1.getDrawObjectCanvas().Children.Add(pl);
                }

                canvasBright.Children.Clear();
                DrawGraphic dg = new DrawGraphic(canvasBright);
                dg.DrawBrightLines(isoc.getImageGrayVLine(b, Convert.ToInt64(p)));
            }
            catch (Exception xe)        //未知的异常
            {
                if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛
                {
                    SilverlightLFC.common.Environment.ShowMessage(xe.Message);
                }
                else
                {
                    SilverlightLFC.common.Environment.ShowMessage("测试错误,请检查照片");
                }
            }
        }