Exemple #1
0
        public void Test(List <WriteableBitmap> b)
        {
            if (b.Count == 0 || b == null)
            {
                return;
            }
            bl = b;
            try
            {
                RefreshShow();

                textBlockNoiseNum.Text     = TotleNoisePixs.ToString();
                textBlockNoisePercent.Text = (Convert.ToDouble(TotleNoisePixs) / TotlePixs * 100).ToString();
                dg.DrawBrightPixNumHistogram(BrightPixList);
            }
            catch (Exception xe)        //未知的异常
            {
                if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛
                {
                    SilverlightLFC.common.Environment.ShowMessage(xe.Message);
                }
                else
                {
                    SilverlightLFC.common.Environment.ShowMessage("测试错误,请检查照片");
                }
            }
        }
        public void DrawHis()
        {
            WriteableBitmap b = null;

            if (pc.SelectLayer != null)
            {
                b = pc.SelectLayer.getPhoto();
            }
            if (b != null)
            {
                DrawGraphic             dg = new DrawGraphic(canvasBH);
                DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest();
                List <int> bl = pt.getBrightPixNum(b);
                dg.DrawBrightPixNumHistogram(bl);
            }
        }
        public void DrawAreaBrightness()
        {
            if (r == null)
            {
                return;
            }
            DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest();
            DrawGraphic             dg = new DrawGraphic(DrawCanvas);
            WriteableBitmap         sb = TargetImage.Source as WriteableBitmap;
            Point           isp        = DrawGraphic.getImagePosition(sp, TargetImage);
            double          iw         = DrawGraphic.getImageDistance(r.Width, TargetImage);
            double          ih         = DrawGraphic.getImageDistance(r.Height, TargetImage);
            WriteableBitmap cb         = pt.getImageArea(sb, (int)isp.X, (int)isp.Y, (int)iw, (int)ih);

            List <int> tl = pt.getBrightPixNum(cb);

            dg.ForeColor = Colors.Blue;
            dg.DrawBrightPixNumHistogram(tl);
            textBlockValue.Text = (iw * ih).ToString();
        }
        public void DrawAreaBrightness()
        {
            if (selectRec == null)
            {
                return;
            }
            DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest();
            DrawGraphic             dg = new DrawGraphic(DrawCanvas);
            WriteableBitmap         sb = TargetImage.Source as WriteableBitmap;
            Point           isp        = DrawGraphic.getImagePosition(sp, TargetImage);
            Point           iep        = DrawGraphic.getImagePosition(ep, TargetImage);
            double          iw         = DrawGraphic.getImageDistance(Math.Abs(iep.X - isp.X), TargetImage);
            double          ih         = DrawGraphic.getImageDistance(Math.Abs(iep.Y - isp.Y), TargetImage);
            WriteableBitmap cb         = pt.getImageArea(sb, (int)isp.X, (int)isp.Y, (int)iw, (int)ih);

            List <int> tl = pt.getBrightPixNum(cb);

            dg.ForeColor = Colors.Blue;
            dg.DrawBrightPixNumHistogram(tl);
            textPointCountValue.Text = (iw * ih).ToString();
            List <Color> cl = pt.getImageColorList(cb);

            ShowBrightInfor(cl);
        }