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

                dg.DrawColorCy(0.9f);

                int n = lynxUpDown1.IntValue;

                dg.DrawColorPoint(Colors.Purple, 0.9f, 3);
                dg.DrawColorHueArea(Colors.Purple, 0.9f, 2, n);
                if (bl.Count == 0)
                {
                    return;
                }
                this.textPruplePercent.Text = (PurplePix / bl.Count).ToString();
            }
            catch (Exception xe)        //未知的异常
            {
                if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛
                {
                    SilverlightLFC.common.Environment.ShowMessage(xe.Message);
                }
                else
                {
                    SilverlightLFC.common.Environment.ShowMessage("测试错误,请检查照片");
                }
            }
        }
        private void buttonClear_Click(object sender, RoutedEventArgs e)
        {
            DrawCanvas.Children.Clear();
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.DrawColorCy(0.9f);
        }
        public void Test(List <WriteableBitmap> b)
        {
            if (b.Count == 0 || b == null)
            {
                return;
            }
            bl = b;
            try
            {
                textBlockWhiteBalance.Text = pt.getWhiteBalance(b).ToString();

                DrawCanvas.Children.Clear();
                dg.DrawColorCy(0.9f);
                RefreshShow();
            }
            catch (Exception xe)        //未知的异常
            {
                if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛
                {
                    SilverlightLFC.common.Environment.ShowMessage(xe.Message);
                }
                else
                {
                    SilverlightLFC.common.Environment.ShowMessage("测试错误,请检查照片");
                }
            }
        }
        Color cc = Colors.Transparent; //当前颜色
        void li_MouseLeftButtonDown(object sender, PointerRoutedEventArgs e)
        {
            Image im = sender as Image;

            currentImage = im;
            Color?tl = im.Tag as Color?;

            if (tl != null)
            {
                sc = tl.Value;
            }
            ShowSourceInfor(sc);

            WriteableBitmap tb = im.Source as WriteableBitmap;

            if (tb == null)
            {
                return;
            }
            lChartPhoto.Source = (tb);
            cc = pt.getAverageColor(tb);
            ShowTrueColorInfor(cc);

            ShowTrueColorDiffrent(cc, sc);

            DrawGraphic dg = new DrawGraphic(CC);

            CC.Children.Clear();
            dg.DrawColorCy(0.9f);
            dg.DrawColorMoveHue(sc, cc, 0.9f);
        }
        public void DrawWhiteBalanceCurve(WriteableBitmap b, string ChartType)//绘制白平衡的分析图
        {
            this.ChartType = ChartType;
            List <Color> al = new List <Color>();

            if (ChartType == "XMark")
            {
                XMarkChart xm = new XMarkChart(b);
                al = xm.getCurveWhiteBalance();
            }
            if (ChartType == "XRite")
            {
                XRiteColorChart x = new XRiteColorChart(b);
                al = x.getCurveWhiteBalance();
            }
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            //dg.InitCanvas(picCanvas.Width, picCanvas.Height);//需要先设置画布
            dg.DrawColorCy(0.9f);

            for (int i = 0; i < al.Count; i++)
            {
                Color c = (Color)al[i];
                dg.DrawColorPoint(c, 0.9f, 3);
            }
        }
        public void DrawColorDisCurve(int cNo, WriteableBitmap b, string ChartType)//绘制单个色差
        {
            this.ChartType = ChartType;
            List <List <Color> > al = new List <List <Color> >();

            if (ChartType == "XMark")
            {
                XMarkChart xm = new XMarkChart(b);
                al  = xm.getCurveColorDis();
                cNo = cNo - 7;
            }
            if (ChartType == "XRite")
            {
                XRiteColorChart x = new XRiteColorChart(b);
                al  = x.getCurveColorDis();
                cNo = cNo - 1;
            }
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.DrawColorCy(0.9f);

            List <Color> tal = al[cNo];
            Color        c0  = (Color)tal[0];
            Color        c1  = (Color)tal[1];

            //picS.BackColor = c0;
            //picV.BackColor = c1;
            dg.DrawColorMoveHue(c0, c1, 0.9f);
        }
        public void DrawColorDisCurve(WriteableBitmap b, string ChartType)//绘制描述色差的图形
        {
            this.ChartType = ChartType;
            List <List <Color> > al = new List <List <Color> >();

            if (ChartType == "XMark")
            {
                XMarkChart xm = new XMarkChart(b);
                al = xm.getCurveColorDis();
            }
            if (ChartType == "XRite")
            {
                XRiteColorChart x = new XRiteColorChart(b);
                al = x.getCurveColorDis();
            }
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.DrawColorCy(0.9f);
            for (int i = 7; i < 19; i++)
            {
                List <Color> tal = al[i - 7];
                Color        c0  = (Color)tal[0];
                Color        c1  = (Color)tal[1];
                //picS.BackColor = c0;
                //picV.BackColor = c1;
                dg.DrawColorMoveHue(c0, c1, 0.9f);
            }
        }
        public void DrawRainbowCurve(WriteableBitmap b, string ChartType)//绘制连续色阶准确性的分析图
        {
            this.ChartType = ChartType;
            List <Color> al = new List <Color>();

            if (ChartType == "XMark")
            {
                XMarkChart xm = new XMarkChart(b);
                al = xm.getCurveRainbow();
            }
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.DrawColorCy(0.9f);

            dg.DrawColorList(al, 0.9f);
        }
Exemple #9
0
        void li_MouseLeftButtonDown(object sender, PointerRoutedEventArgs e)
        {
            DrawCanvas.Children.Clear();
            Image im = sender as Image;
            //int No = Convert.ToInt32(im.Tag);
            WriteableBitmap cb = im.Source as WriteableBitmap;

            lChartPhoto1.setPhoto(cb);
            //image.Source = bl[No - 1];
            int n = lynxUpDown1.IntValue;

            this.textPruplePercent.Text = ptp.getPurpleEdge(cb, n).ToString();
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.DrawColorCy(0.9f);
            dg.DrawColorHueArea(Colors.Purple, 0.9f, 2, n);
            dg.DrawColorPoint(cb, 0.9f, 3);
        }
Exemple #10
0
 void RefreshShow()
 {
     currentImage = null;
     CC.Children.Clear();
     dg.DrawColorCy(0.9f);
     stackBitmapList.Children.Clear();
     for (int i = 1; i <= pl.Count; i++)
     {
         WriteableBitmap bi = pl[i - 1];
         Image           li = new Image();
         li.Width  = stackBitmapList.Width / pl.Count;
         li.Height = stackBitmapList.Height;
         double w = li.Height * bi.PixelWidth / bi.PixelHeight;
         if (li.Width > w)
         {
             li.Width = w;
         }
         li.Source = bi;
         li.Tag    = sl[i - 1];//附属的是原始的理论颜色
         stackBitmapList.Children.Add(li);
         li.PointerPressed += (li_MouseLeftButtonDown);
         dg.DrawColorMoveHue(sl[i - 1], pt.getAverageColor(bi), 0.9f);
     }
 }
Exemple #11
0
 public void ShowCC()
 {
     DrawCanvas.Children.Clear();
     dg.DrawColorCy(0.9f);
 }