Example #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("测试错误,请检查照片");
                }
            }
        }
Example #2
0
        void LoadPhoto(WriteableBitmap TargetPhoto)
        {
            if (TargetPhoto == null)
            {
                return;
            }
            lChartPhoto1.setPhoto(TargetPhoto);
            Color c = pt.getAverageColor(TargetPhoto);

            textBlockR.Text = c.R.ToString();
            textBlockG.Text = c.G.ToString();
            textBlockB.Text = c.B.ToString();

            double rg = (Convert.ToDouble(c.R) / Convert.ToDouble(c.G));
            double bg = (Convert.ToDouble(c.R) / Convert.ToDouble(c.G));

            textBlockJBBG.Text = bg.ToString();
            textBlockJBRG.Text = rg.ToString();
            if (rg > 0.8 && rg < 1.2 && bg > 0.8 && bg < 1.2)
            {
                ChartTestHelper.setGBSign(true, gridGB);
            }
            else
            {
                ChartTestHelper.setGBSign(false, gridGB);
            }


            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.ForeColor = Colors.Blue;
            dg.DrawColorPoint(c, 0.9f, 3);
        }
Example #3
0
        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);
            }
        }
Example #4
0
 public void ShowColor(Color c)
 {
     textB.Text  = c.B.ToString();
     textBr.Text = DCTestLibrary.PhotoTest.getBrightness(c).ToString();
     textG.Text  = c.G.ToString();
     textH.Text  = DCTestLibrary.PhotoTest.getHue(c).ToString();
     textR.Text  = c.R.ToString();
     textS.Text  = DCTestLibrary.PhotoTest.getSaturation(c).ToString();
     dg.DrawColorPoint(c, 0.9f, 3);
 }
Example #5
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);
        }
Example #6
0
 void RefreshShow()
 {
     stackBitmapList.Children.Clear();
     for (int i = 1; i <= bl.Count; i++)
     {
         WriteableBitmap bi = bl[i - 1];
         Image           li = new Image();
         li.Source = bi;
         li.Width  = stackBitmapList.Width / bl.Count;
         li.Height = stackBitmapList.Height;
         double w = li.Height * bi.PixelWidth / bi.PixelHeight;
         if (li.Width > w)
         {
             li.Width = w;
         }
         li.Tag = i;
         stackBitmapList.Children.Add(li);
         li.PointerPressed += (li_MouseLeftButtonDown);
         cl.Add(pt.getAverageColor(bi));
         dg.DrawColorPoint(cl[i - 1], 0.9f, 3);
     }
 }