Exemplo n.º 1
0
        void timer_Tick(object sender, EventArgs e)
        {
            if (counter == 50)
            {
                Point     p    = Picker.GetMousePoint();
                ColorCode code = new ColorCode(Picker.GetPixelColor((int)p.X, (int)p.Y));
                tipsWin.ShowTips(code, p);
                counter = -1;
                //System.Console.WriteLine("------------"+counter);
                return;
            }
            //System.Console.WriteLine(counter);
            Point mouseCurPoint = Picker.GetMousePoint();

            if (Math.Abs(mousePoint.X - mouseCurPoint.X) < 5 && Math.Abs(mousePoint.Y - mouseCurPoint.Y) < 5)
            {
                if (counter > -1)
                {
                    counter++;
                }
            }
            else
            {
                counter    = 0;
                mousePoint = mouseCurPoint;
            }
        }
Exemplo n.º 2
0
 public ClickEventHandler()
 {
     colorSpectrum = ColorSpectrum.Inst;
     colorBrightness = ColorBrightness.Inst;
     colorSaturation = ColorSaturation.Inst;
     colorSquare = ColorSquare.Inst;
     colorViewHandler = ColorView.Inst;
     colorCodeHandler = ColorCode.Inst;
     alphaColorCodeHandler = AColorCode.Inst;
     colorScalesHandler = ColorScales.Inst;
     alphaView = AlphaView.Inst;
     inst = this;
 }
Exemplo n.º 3
0
 public ClickEventHandler()
 {
     colorSpectrum         = ColorSpectrum.Inst;
     colorBrightness       = ColorBrightness.Inst;
     colorSaturation       = ColorSaturation.Inst;
     colorSquare           = ColorSquare.Inst;
     colorViewHandler      = ColorView.Inst;
     colorCodeHandler      = ColorCode.Inst;
     alphaColorCodeHandler = AColorCode.Inst;
     colorScalesHandler    = ColorScales.Inst;
     alphaView             = AlphaView.Inst;
     inst = this;
 }
Exemplo n.º 4
0
        public void ShowTips(ColorCode code, Point point)
        {
            if (isPause)
            {
                return;
            }
            if (!isFix)
            {
                this.Top  = point.Y - 20;
                this.Left = point.X;
            }
            TbHex.Text = code.GetCodeInHex();
            rect.Fill  = new SolidColorBrush(code.GetColor());
            this.Show();
            Storyboard      sb = new Storyboard();
            DoubleAnimation da = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(0.3));

            Storyboard.SetTarget(da, this);
            Storyboard.SetTargetProperty(da, new PropertyPath(Window.OpacityProperty));
            sb.Children.Add(da);
            sb.Begin();
        }
Exemplo n.º 5
0
 public ColorCode(Entry colorCode)
 {
     this.colorCode = colorCode;
     inst = this;
 }
Exemplo n.º 6
0
 public ColorCode(Entry colorCode)
 {
     this.colorCode = colorCode;
     inst           = this;
 }
Exemplo n.º 7
0
 public void ShowColorCode(ColorCode color)
 {
     TbColorCode1.Text = color.GetCodeInHex();
     TbColorCode2.Text = color.GetCodeInDec();
 }