using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using TemuKJD.BaseForms; namespace TemuKJD.ToolForms { public partial class ShowImgForm : LRBaseForm { string currentImgUrl = null; Dictionary imgDic = new Dictionary(); public ShowImgForm(string picUrl, Dictionary picDic = null) { InitializeComponent(); currentImgUrl = picUrl; if (picDic != null) imgDic = picDic; if (!string.IsNullOrEmpty(currentImgUrl)) { this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http"); } } private void btnClose_Click(object sender, EventArgs e) { this.Close(); } private void ShowImgForm_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { //case Keys.A: MessageBox.Show("您按下的是A"); break; //case Keys.B: MessageBox.Show("您按下的是B"); break; case Keys.Enter: break; case Keys.Escape: this.Close(); break; } } private void btnCopyUrl_Click(object sender, EventArgs e) { try { Clipboard.SetText(currentImgUrl); // 设置剪贴板内容 BaseMsgForm.ShowInfo("图片地址已复制到剪贴板"); } catch (Exception ex) { BaseMsgForm.ShowError("复制图片地址到剪贴板失败: " + ex.Message); } } private void btnCopy_Click(object sender, EventArgs e) { try { Clipboard.SetImage(this.pictureBox1.Image); // 设置剪贴板内容 BaseMsgForm.ShowInfo("图片已复制到剪贴板"); } catch (Exception ex) { BaseMsgForm.ShowError("复制图片到剪贴板失败: " + ex.Message); } } } }