/// <summary> Display the watermark as it would appear after the watermark were saved to the file </summary>
        private void btnPreview_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtWaterMark.Text))
            {
                ShowError("Cannot preview blank text.");
                return;
            }
            else if (FileToolbox.IsJpg(_currentFile))
            {
                MessageBox.Show("Cannot do watermarks on JPG files because JPG does not handle opacity so aborting.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            // Update the application by reloading the image
            picContainer.Image = ImageActionToolbox.GetImage(_currentFile);

            ImageActionToolbox.DrawWatermark(picContainer.Image, optTop.Checked, txtWaterMark.Text, _currentWatermarkFont, _currentWatermarkColor, picContainer.Top, cboOpacity.Text);
        }
Beispiel #2
0
 private static string GetImageFilterWithCurrentAtTop(string fileName, out string extension)
 {
     extension = FileToolbox.GetExtension(fileName, false);
     return(GetImageSaveFilterWithCurrentAtTop(extension));
 }