Example #1
0
 private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && this.pictureBox1.Cursor == Cursors.Cross && !wantCorp)
     {
         StartX = e.X;
         StartY = e.Y;
         WaterMark wm = new WaterMark();
         wm.Left = this.PointToScreen(e.Location).X;
         wm.Top  = this.PointToScreen(e.Location).Y;
         DialogResult dr = wm.ShowDialog();
         if (dr == DialogResult.OK)
         {
             if (wm.WaterImage == null)
             {
                 wmText = wm.WaterMarkText;
                 toolStripButton2.Enabled = false;
                 backgroundWorker1.RunWorkerAsync("WaterMark");
                 toolStripStatusLabel1.Text = "正在对图像添加水印.....";
             }
             else
             {
                 waterImg = wm.WaterImage;
                 toolStripButton2.Enabled = false;
                 backgroundWorker1.RunWorkerAsync("WaterMarkWithImage");
                 toolStripStatusLabel1.Text = "正在对图像添加图像水印.....";
             }
         }
     }
     else if (e.Button == MouseButtons.Left && this.pictureBox1.Cursor == Cursors.Cross && wantCorp)
     {
         StartX = e.X;
         StartY = e.Y;
     }
 }
Example #2
0
 private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && this.pictureBox1.Cursor == Cursors.Cross && !wantCorp)
     {
         StartX = e.X;
         StartY = e.Y;
         WaterMark wm = new WaterMark();
         wm.Left = this.PointToScreen(e.Location).X;
         wm.Top = this.PointToScreen(e.Location).Y;
         DialogResult dr  =   wm.ShowDialog();
         if (dr == DialogResult.OK)
         {
             if (wm.WaterImage == null)
             {
                 wmText = wm.WaterMarkText;
                 toolStripButton2.Enabled = false;
                 backgroundWorker1.RunWorkerAsync("WaterMark");
                 toolStripStatusLabel1.Text = "���ڶ�ͼ�����ˮӡ.....";
             }
             else
             {
                 waterImg = wm.WaterImage;
                 toolStripButton2.Enabled = false;
                 backgroundWorker1.RunWorkerAsync("WaterMarkWithImage");
                 toolStripStatusLabel1.Text = "���ڶ�ͼ�����ͼ��ˮӡ.....";
             }
         }
     }
     else if (e.Button == MouseButtons.Left && this.pictureBox1.Cursor == Cursors.Cross && wantCorp)
     {
         StartX = e.X;
         StartY = e.Y;
     }
 }