Пример #1
0
        private void button6_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            ToolFunctions.ClearEvent(this.pictureBox_WorkPlace, "MouseDown");
            ToolFunctions.ClearEvent(this.pictureBox_WorkPlace, "MouseUp");

            if (btn.Text == "使用吸管")
            {
                btn.Text = "使用画笔";
                this.pictureBox_WorkPlace.MouseDown += PictureBox_WorkPlace_MouseDown_GetColor;
                this.button_Mosaic.Enabled           = false;
            }
            else if (btn.Text == "使用画笔")
            {
                btn.Text = "使用吸管";
                this.pictureBox_WorkPlace.MouseDown += pictureBox2_Paint_MouseDown;
                this.pictureBox_WorkPlace.MouseUp   += pictureBox2_Paint_MouseUp;
                this.button_Mosaic.Enabled           = true;
            }
        }
Пример #2
0
 private void Page_Reset()
 {
     ToolFunctions.ClearEvent(pictureBox_WorkPlace, "MouseMove");
     ToolFunctions.ClearEvent(pictureBox_WorkPlace, "MouseClick");
     ToolFunctions.ClearEvent(pictureBox_WorkPlace, "MouseUp");
     label_funcName.Text = tabControl1.SelectedTab == null?"empty": tabControl1.SelectedTab.Text;
     if (isChoosed == true)
     {
         if (tabControl1.SelectedTab == tabPage_Paint)
         {
             Paint_Page_Init();
             Console.WriteLine("in paint");
         }
         else if (tabControl1.SelectedTab == tabPage_Grey)
         {
             Grey_Page_Init();
             Console.WriteLine("in grey");
         }
         else if (tabControl1.SelectedTab == tabPage_Hsi)
         {
             Hsi_Page_Init();
         }
     }
 }