Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string oldpath = @"C:\Users\dell\Pictures\气泡星云.jpg";
            string newpath = @"F:\testXiangmu\picHelp\picHelp\uppic\";

            ImageClass.MakeThumbnail(oldpath, newpath, 6700, 3200, "HW");
            txtboxPath = null;
        }
Пример #2
0
 private void btnThumbnail_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(CBOboxStyleThum.Text) && !string.IsNullOrEmpty(txtHeight.Text) && !string.IsNullOrEmpty(txtWidth.Text))
     {
         OpenFileDialog dialog = new OpenFileDialog();
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             this.txtboxPath.SelectedText = dialog.FileName;
             string txtoldpath = dialog.FileName;//this.txtboxPath.Text;
             string newpath    = @"F:\testXiangmu\picHelp\picHelp\uppic\";
             ImageClass.MakeThumbnail(txtoldpath, newpath, Convert.ToInt32(txtWidth.Text), Convert.ToInt32(txtHeight.Text), CBOboxStyleThum.Text);
             this.txtboxPath.Text = null;
         }
     }
     else
     {
         MessageBox.Show("缩略方式,宽高度不能为空!");
         txtboxPath = null;
     }
 }
Пример #3
0
        private void btnWatermark_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                this.txtboxPath.SelectedText = dialog.FileName;
                string txtoldpath = this.txtboxPath.Text;
                if (!String.IsNullOrEmpty(RtbWaterMark.Text.Trim()))
                {
                    if (!String.IsNullOrEmpty(cbxLocation.Text.Trim()))
                    {
                        ImageClass.LetterWatermark(txtoldpath, 49, RtbWaterMark.Text, Color.Red, cbxLocation.Text.Trim());
                    }
                }
                txtboxPath.Text = "";
            }
            else
            {
                MessageBox.Show("正常", "提示", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Exclamation);
            }
        }