Esempio n. 1
0
        void tm_Tick(object sender, EventArgs e)
        {
            YeShen yy = new YeShen();
            Point  p  = yy.GetMouseRelativePos();

            //APIHelper.GetCursorPos(out p);
            label4.Text = p.X.ToString() + "," + p.Y.ToString();;


            int w, h;

            yy.GetYshenBig(out w, out h);
            label2.Text = w.ToString() + "x" + h.ToString();

            label5.Text = ((double)p.X / w).ToString("0.00%") + "," + ((double)p.Y / h).ToString("0.00%");

            Color cl = yy.GetPixColor(p.X, p.Y);

            label1.Text  = cl.R.ToString() + ",";
            label1.Text += cl.G.ToString() + ",";
            label1.Text += cl.B.ToString();

            /*Color cl2 = yy.GetAvgColor(p.X, p.Y);
             * label19.Text = cl2.R.ToString() + ",";
             * label19.Text += cl2.G.ToString() + ",";
             * label19.Text += cl2.B.ToString();*/
            label19.Text = "暂不支持!";

            //button2_Click_1(null, null);
        }
Esempio n. 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            YeShen yy = new YeShen();
            double x  = Convert.ToDouble(textBox1.Text);
            double y  = Convert.ToDouble(textBox2.Text);
            Color  cl = yy.GetPixColor(x, y);

            label6.Text  = cl.R.ToString() + ",";
            label6.Text += cl.G.ToString() + ",";
            label6.Text += cl.B.ToString();
        }
 public bool IsHere(List <PlaceAttr> pls)
 {
     foreach (PlaceAttr pa in pls)
     {
         Color ral = yeshen.GetPixColor(pa.Position.X, pa.Position.Y);
         if (!JudgeColor(ral, pa.AttrColor, pa.Tolerate))
         {
             return(false);
         }
     }
     return(true);
 }