예제 #1
0
        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);
        }