增加云仓数据
This commit is contained in:
1 parent
2dfec55b5f
commit
55258d0d91
14 files changed
+2733
-1028
No files matched your search
+213
-205
@@ -13,223 +13,231 @@ using TemuKJD.BaseForms;
|
||||
|
||||
namespace TemuKJD.ToolForms
|
||||
{
|
||||
public partial class ShowImgForm : BaseGeneralForm
|
||||
{
|
||||
string currentImgUrl = null;
|
||||
Dictionary<string, string> imgDic = new Dictionary<string, string>();
|
||||
public partial class ShowImgForm : BaseGeneralForm
|
||||
{
|
||||
string currentImgUrl = null;
|
||||
Dictionary<string, string> imgDic = new Dictionary<string, string>();
|
||||
|
||||
public ShowImgForm(string picUrl)
|
||||
{
|
||||
InitializeComponent();
|
||||
currentImgUrl = picUrl;
|
||||
public ShowImgForm(string picUrl)
|
||||
{
|
||||
InitializeComponent();
|
||||
currentImgUrl = picUrl;
|
||||
|
||||
if (!string.IsNullOrEmpty(currentImgUrl))
|
||||
{
|
||||
if (currentImgUrl.Contains("wxapp"))
|
||||
{
|
||||
string getImgError = "";
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(currentImgUrl, out getImgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(currentImgUrl))
|
||||
{
|
||||
if (currentImgUrl.Contains("wxapp"))
|
||||
{
|
||||
string getImgError = "";
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(currentImgUrl, out getImgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
}
|
||||
|
||||
//string getImgError = "";
|
||||
//var image = AllBase.GetHtml.GetUrlImg(currentImgUrl, out getImgError);
|
||||
//if (!string.IsNullOrEmpty(getImgError))
|
||||
// //BaseMsgForm.ShowError("图片加载失败 " + getImgError);
|
||||
// image = TemuKJD.Properties.Resources.errpic;
|
||||
//this.pictureBox1.Image = image;
|
||||
}
|
||||
}
|
||||
//string getImgError = "";
|
||||
//var image = AllBase.GetHtml.GetUrlImg(currentImgUrl, out getImgError);
|
||||
//if (!string.IsNullOrEmpty(getImgError))
|
||||
// //BaseMsgForm.ShowError("图片加载失败 " + getImgError);
|
||||
// image = TemuKJD.Properties.Resources.errpic;
|
||||
//this.pictureBox1.Image = image;
|
||||
}
|
||||
}
|
||||
|
||||
public ShowImgForm(string picUrl, Dictionary<string, string> picDic)
|
||||
{
|
||||
InitializeComponent();
|
||||
currentImgUrl = picUrl;
|
||||
if (picDic != null)
|
||||
imgDic = picDic;
|
||||
public ShowImgForm(string picUrl, Dictionary<string, string> picDic)
|
||||
{
|
||||
InitializeComponent();
|
||||
currentImgUrl = picUrl;
|
||||
if (picDic != null)
|
||||
imgDic = picDic;
|
||||
|
||||
if (!string.IsNullOrEmpty(currentImgUrl))
|
||||
{
|
||||
if (picDic != null)
|
||||
{
|
||||
if (currentImgUrl.Contains("wxapp"))
|
||||
{
|
||||
string getImgError = "";
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(currentImgUrl, out getImgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(currentImgUrl))
|
||||
{
|
||||
if (picDic != null)
|
||||
{
|
||||
if (currentImgUrl.Contains("wxapp"))
|
||||
{
|
||||
string getImgError = "";
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(currentImgUrl, out getImgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ShowImgForm(Image img)
|
||||
{
|
||||
InitializeComponent();
|
||||
public ShowImgForm(Image img, string picUrl = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
currentImgUrl = picUrl;
|
||||
if (img != null)
|
||||
{
|
||||
this.pictureBox1.Image = img;
|
||||
}
|
||||
}
|
||||
public ShowImgForm(Image img)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (img != null)
|
||||
{
|
||||
this.pictureBox1.Image = img;
|
||||
}
|
||||
}
|
||||
if (img != null)
|
||||
{
|
||||
this.pictureBox1.Image = img;
|
||||
}
|
||||
}
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
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;
|
||||
case Keys.Space:
|
||||
//if (imgDic != null && imgDic.Keys.Count > 0)
|
||||
//{
|
||||
// for (int i = 0; i < imgDic.Keys.ToList().Count; i++)
|
||||
// {
|
||||
// if (imgDic.Keys.ToList()[i] == currentImgUrl)
|
||||
// {
|
||||
// int index = i + 1;
|
||||
// if (index == imgDic.Keys.Count)
|
||||
// index = 0;
|
||||
// currentImgUrl = imgDic.Keys.ToList()[index];
|
||||
// this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
// break;
|
||||
// }
|
||||
// if (imgDic[imgDic.Keys.ToList()[i]] == currentImgUrl)
|
||||
// {
|
||||
// int index = i + 1;
|
||||
// if (index == imgDic.Keys.Count)
|
||||
// index = 0;
|
||||
// currentImgUrl = imgDic[imgDic.Keys.ToList()[index]];
|
||||
// this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
pictureBox1_Click(null, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
case Keys.Space:
|
||||
//if (imgDic != null && imgDic.Keys.Count > 0)
|
||||
//{
|
||||
// for (int i = 0; i < imgDic.Keys.ToList().Count; i++)
|
||||
// {
|
||||
// if (imgDic.Keys.ToList()[i] == currentImgUrl)
|
||||
// {
|
||||
// int index = i + 1;
|
||||
// if (index == imgDic.Keys.Count)
|
||||
// index = 0;
|
||||
// currentImgUrl = imgDic.Keys.ToList()[index];
|
||||
// this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
// break;
|
||||
// }
|
||||
// if (imgDic[imgDic.Keys.ToList()[i]] == currentImgUrl)
|
||||
// {
|
||||
// int index = i + 1;
|
||||
// if (index == imgDic.Keys.Count)
|
||||
// index = 0;
|
||||
// currentImgUrl = imgDic[imgDic.Keys.ToList()[index]];
|
||||
// this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
pictureBox1_Click(null, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
private void btnCopyUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetText(currentImgUrl); // 设置剪贴板内容
|
||||
BaseMsgForm.ShowInfo("图片地址已复制到剪贴板");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError("复制图片地址到剪贴板失败: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
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); // 设置剪贴板内容
|
||||
this.btnCopy.Text = "已复制";
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(2500);
|
||||
Invoke(new Action(() => { this.btnCopy.Text = "复制图片"; }));
|
||||
});
|
||||
//BaseMsgForm.ShowInfo("图片已复制到剪贴板");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError("复制图片到剪贴板失败: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetImage(this.pictureBox1.Image); // 设置剪贴板内容
|
||||
this.btnCopy.Text = "已复制";
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(2500);
|
||||
Invoke(new Action(() => { this.btnCopy.Text = "复制图片"; }));
|
||||
});
|
||||
//BaseMsgForm.ShowInfo("图片已复制到剪贴板");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError("复制图片到剪贴板失败: " + ex.Message);
|
||||
}
|
||||
}
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.pictureBox1.Image == null)
|
||||
{
|
||||
BaseMsgForm.ShowError("图片为空!");
|
||||
return;
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(this.pictureBox1.Image == null)
|
||||
{
|
||||
BaseMsgForm.ShowError("图片为空!");
|
||||
return;
|
||||
}
|
||||
string fileName = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".jpg";
|
||||
if (!string.IsNullOrEmpty(this.pictureBox1.ImageLocation))
|
||||
{
|
||||
fileName = this.pictureBox1.ImageLocation.Replace("://", ".").Replace('/', '.');
|
||||
}
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "JPeg Image|*.jpg;*.jpeg";
|
||||
sfd.Title = "保存图片";
|
||||
sfd.FileName = fileName;
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
pictureBox1.Image.Save(sfd.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string fileName = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".jpg";
|
||||
if (!string.IsNullOrEmpty(this.pictureBox1.ImageLocation))
|
||||
{
|
||||
fileName = this.pictureBox1.ImageLocation.Replace("://",".").Replace('/', '.');
|
||||
}
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "JPeg Image|*.jpg;*.jpeg";
|
||||
sfd.Title = "保存图片";
|
||||
sfd.FileName = fileName;
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
pictureBox1.Image.Save(sfd.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void pictureBox1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (imgDic != null && imgDic.Keys.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < imgDic.Keys.ToList().Count; i++)
|
||||
{
|
||||
if (imgDic.Keys.ToList()[i] == currentImgUrl)
|
||||
{
|
||||
int index = i + 1;
|
||||
if (index == imgDic.Keys.Count)
|
||||
index = 0;
|
||||
currentImgUrl = imgDic.Keys.ToList()[index];
|
||||
if (currentImgUrl.Contains("wxapp"))
|
||||
{
|
||||
string getImgError = "";
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(currentImgUrl, out getImgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (imgDic[imgDic.Keys.ToList()[i]] == currentImgUrl)
|
||||
{
|
||||
int index = i + 1;
|
||||
if (index == imgDic.Keys.Count)
|
||||
index = 0;
|
||||
currentImgUrl = imgDic[imgDic.Keys.ToList()[index]];
|
||||
if (currentImgUrl.Contains("wxapp"))
|
||||
{
|
||||
string getImgError = "";
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(currentImgUrl, out getImgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void pictureBox1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (imgDic != null && imgDic.Keys.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < imgDic.Keys.ToList().Count; i++)
|
||||
{
|
||||
if (imgDic.Keys.ToList()[i] == currentImgUrl)
|
||||
{
|
||||
int index = i + 1;
|
||||
if (index == imgDic.Keys.Count)
|
||||
index = 0;
|
||||
currentImgUrl = imgDic.Keys.ToList()[index];
|
||||
if (currentImgUrl.Contains("wxapp"))
|
||||
{
|
||||
string getImgError = "";
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(currentImgUrl, out getImgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (imgDic[imgDic.Keys.ToList()[i]] == currentImgUrl)
|
||||
{
|
||||
int index = i + 1;
|
||||
if (index == imgDic.Keys.Count)
|
||||
index = 0;
|
||||
currentImgUrl = imgDic[imgDic.Keys.ToList()[index]];
|
||||
if (currentImgUrl.Contains("wxapp"))
|
||||
{
|
||||
string getImgError = "";
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(currentImgUrl, out getImgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pictureBox1.ImageLocation = currentImgUrl.Replace("https", "http");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowImgForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
label1.Visible = this.imgDic != null && this.imgDic.Keys.Count > 0;
|
||||
}
|
||||
}
|
||||
private void ShowImgForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
label1.Visible = this.imgDic != null && this.imgDic.Keys.Count > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user