public static DialogResult ShowFontDialog(WatermarkConfig Config) { DialogResult result = DialogResult.Cancel; try { var fDialog = new FontDialog { ShowColor = true }; try { fDialog.Color = Config.WatermarkFontArgb; fDialog.Font = Config.WatermarkFont; } catch (Exception err) { DebugHelper.WriteException(err, "Error while initializing Font and Color"); } result = fDialog.ShowDialog(); if (result == DialogResult.OK) { Config.WatermarkFont = fDialog.Font; Config.WatermarkFontArgb = fDialog.Color; } } catch (Exception ex) { DebugHelper.WriteException(ex, "Error while setting Watermark Font"); } return result; }
public WatermarkUI(WatermarkConfig cfg = null) { InitializeComponent(); if (cfg == null) { Config = new WatermarkConfig(); } else { Config = cfg; } codesMenu = new ContextMenuStrip(); codesMenu.AutoClose = false; codesMenu.Font = new XFont("Lucida Console", 8); codesMenu.Opacity = 0.8; codesMenu.ShowImageMargin = false; }
public WatermarkEffects(WatermarkConfig Config) { this.Config = Config; }