Ejemplo n.º 1
0
        LChartPhoto selectedImage;//当前选择的

        private void buttonClose_Click(object sender, RoutedEventArgs e)
        {
            bl = null;
            photoTestToolbar1 = null;
            ImageBrightCurve.Children.Clear();
            VB.setPhoto(null);
            HB.setPhoto(null);
            Panel p = this.Parent as Panel;

            if (p != null)
            {
                p.Children.Remove(this);
            }
        }
Ejemplo n.º 2
0
 public void AddPhoto(WriteableBitmap photo)
 {
     if (selectedImage == null)
     {
         return;
     }
     if (selectedImage == HB)
     {
         HB.setPhoto(photo);
         bl[1] = photo;
     }
     if (selectedImage == VB)
     {
         VB.setPhoto(photo);
         bl[2] = photo;
     }
 }
Ejemplo n.º 3
0
        public void RemovePhoto(WriteableBitmap b)
        {
            if (selectedImage == null)
            {
                return;
            }
            int i = bl.IndexOf(b);

            if (i == 1)
            {
                bl.RemoveAt(1);
                HB.setPhoto(null);
            }
            if (i == 2)
            {
                bl.RemoveAt(2);
                VB.setPhoto(null);
            }
        }
Ejemplo n.º 4
0
        public void Test(List <WriteableBitmap> b)
        {
            if (b.Count == 0 || b == null)
            {
                return;
            }
            bl = b;
            try
            {
                HB.setPhoto(b[1]);
                VB.setPhoto(b[2]);
                xt = new XMarkChart();
                decimal d = xt.getBrightChanges(b[0]);//原始
                textBoxBrightChanges.Text = d.ToString();
                textBoxBB.Text            = xt.ProcessInfor["BrightChanges_BorderBright"].ToString();
                textBoxCB.Text            = xt.ProcessInfor["BrightChanges_CBright"].ToString();
                LT.Text = xt.ProcessInfor["BrightChanges_LT"].ToString();
                LB.Text = xt.ProcessInfor["BrightChanges_LB"].ToString();
                RT.Text = xt.ProcessInfor["BrightChanges_RT"].ToString();
                RB.Text = xt.ProcessInfor["BrightChanges_RB"].ToString();

                List <int> hl, vl;
                DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest();
                hl           = pt.getImageGrayHLine(b[1], b[1].PixelHeight / 2);
                vl           = pt.getImageGrayVLine(b[2], b[2].PixelWidth / 2);
                dg.ForeColor = Colors.Blue;
                dg.DrawBrightLines(hl);
                dg.ForeColor = Colors.Red;
                dg.DrawBrightLines(vl);
            }
            catch (Exception xe)        //未知的异常
            {
                if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛
                {
                    SilverlightLFC.common.Environment.ShowMessage(xe.Message);
                }
                else
                {
                    SilverlightLFC.common.Environment.ShowMessage("测试错误,请检查照片");
                }
            }
        }