Esempio n. 1
0
        public FormMain()
        {
            InitializeComponent();

            ColorOnMouse.UsageDPI();

            MouseHook.Start();
            MouseHook.MouseAction += MouseHook_MouseAction;

            KeyboardHook.Start();
            KeyboardHook.KeyboardAction += KeybordHook_KeyboardAction;

            this.picImage.Paint  += picImage_Paint;
            this.picExpand.Paint += PicExpand_Paint;
            this.picColor.Paint  += PicColor_Paint;

            this.tbR.TextChanged   += Tb_TextChanged;
            this.tbG.TextChanged   += Tb_TextChanged;
            this.tbB.TextChanged   += Tb_TextChanged;
            this.tbHex.TextChanged += Tb_TextChanged;

            this.btnCopyRGB.MouseLeave += setMouseHook;
            this.btnCopyRGB.MouseHover += unMouseHook;
            this.btnCopyHEX.MouseLeave += setMouseHook;
            this.btnCopyHEX.MouseHover += unMouseHook;

            this.radioBackColor.MouseLeave += setMouseHook;
            this.radioBackColor.MouseHover += unMouseHook;
            this.radioForeColor.MouseLeave += setMouseHook;
            this.radioForeColor.MouseHover += unMouseHook;
        }
Esempio n. 2
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            if (bmpCaptured != null)
            {
                bmpCaptured.Dispose();
                bmpCaptured = null;
            }

            if (bmpCapturedExapnd != null)
            {
                bmpCapturedExapnd.Dispose();
                bmpCapturedExapnd = null;
            }

            bmpCaptured       = ColorOnMouse.CaptureImage(MousePosition.X, MousePosition.Y);
            bmpCapturedExapnd = new Bitmap(bmpCaptured, new Size(bmpCaptured.Width * 8, bmpCaptured.Height * 8));
            colorPicked       = ColorOnMouse.GetColor();

            picImage.Invalidate();
            picExpand.Invalidate();
            picColor.Invalidate();
        }