Exemplo n.º 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("测试错误,请检查照片");
                }
            }
        }
Exemplo n.º 2
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);
        }