コード例 #1
0
        private void Get_Posix_Color()
        {
            try
            {
                var   pt      = Cursor.Position;
                var   wnd     = WindowFromPoint(pt.X, pt.Y);
                var   mainWnd = GetAncestor(wnd, GaRoot);
                Point point;
                if (Mode == 0)
                {
                    point.X = Cursor.Position.X;
                    point.Y = Cursor.Position.Y;
                    txtTitle.Clear();
                    //GetAppName.App = null;
                    TFive.App = null;
                    txtClassName.Clear();
                    //GetAppName.Class = null;
                    TFive.Class = null;
                }
                else
                {
                    point.X = pt.X;
                    point.Y = pt.Y;
                    ScreenToClient(mainWnd, ref point);
                    //txt_title.Text = Win32.GetWindowText(mainWnd);
                    txtTitle.Text = TFive.GetWindowsTitle(mainWnd);
                    //GetAppName.App = txtTitle.Text;
                    TFive.App = txtTitle.Text;
                    //txt_class.Text = Win32.GetClassName(mainWnd);
                    txtClassName.Text = TFive.GetWindowsClassName(mainWnd);
                    //GetAppName.Class = txtClassName.Text;
                    TFive.Class = txtClassName.Text;
                    //dataGridView1[1, 4].Value = $"{GetColor_.GetControlSize(mainWnd).Width}, {GetColor_.GetControlSize(mainWnd).Height}";
                    dataGridView1[1, 4].Value = $"{TFive.GetControlSize(mainWnd).Width}, {TFive.GetControlSize(mainWnd).Height}";
                }
                //GetAppName.GetWindow();
                TFive.GetAppName();
                //IntPtr = GetAppName.AppName;
                IntPtr = TFive.AppName;
                dataGridView1[1, 0].Value = $"{point.X}, {point.Y}";
                //dataGridView1[1, 1].Value = GetColor_.GetColorString(int.Parse(point.X.ToString()), int.Parse(point.Y.ToString()));
                dataGridView1[1, 1].Value = TFive.GetHexColor(int.Parse(point.X.ToString()), int.Parse(point.Y.ToString()));
                dataGridView1[1, 2].Value = GenerateRgba();

                _checkX = point.X;
                _checkY = point.Y;

                panel_color.BackColor = _magnify.magnifyingGlass1.PixelColor;
                LocationMagnify();
            }
            catch
            {
                // ignored
            }
        }
コード例 #2
0
        private string CheckResult(int posX, int posY)
        {
            //var color = GetColor_.StringColor(dataGridView1[1, 1].Value.ToString());
            var color = TFive.StringColor(dataGridView1[1, 1].Value.ToString());
            var x     = posX;
            var y     = posY;
            //var status = GetColor_.GetColorFast(IntPtr, x, y, color, 4).ToString();
            var status = TFive.GetColor(IntPtr, x, y, color).ToString();

            return(status);
        }