活动报名逻辑优化

This commit is contained in:
wule committed 2025-09-26 09:23:05 +08:00
1 parent d01d3bc306
commit 8fb90422a2
15 files changed
+1736 -291

No files matched your search

+37 -9
View File
@@ -34,6 +34,7 @@ namespace TemuKJD.ToolForms
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.btnCopy = new DevComponents.DotNetBar.PanelEx();
this.btnCopyUrl = new DevComponents.DotNetBar.PanelEx();
this.btnClose = new DevComponents.DotNetBar.PanelEx();
this.btnSave = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
@@ -57,9 +58,10 @@ namespace TemuKJD.ToolForms
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.btnSave);
this.splitContainer1.Panel2.Controls.Add(this.btnCopy);
this.splitContainer1.Panel2.Controls.Add(this.btnCopyUrl);
this.splitContainer1.Panel2.Controls.Add(this.btnSave);
this.splitContainer1.Panel2.Controls.Add(this.btnClose);
this.splitContainer1.Size = new System.Drawing.Size(648, 686);
this.splitContainer1.SplitterDistance = 648;
this.splitContainer1.TabIndex = 1;
@@ -82,7 +84,7 @@ namespace TemuKJD.ToolForms
this.btnCopy.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCopy.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCopy.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCopy.Location = new System.Drawing.Point(338, 4);
this.btnCopy.Location = new System.Drawing.Point(295, 4);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(65, 26);
this.btnCopy.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -107,7 +109,7 @@ namespace TemuKJD.ToolForms
this.btnCopyUrl.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnCopyUrl.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCopyUrl.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCopyUrl.Location = new System.Drawing.Point(237, 4);
this.btnCopyUrl.Location = new System.Drawing.Point(194, 4);
this.btnCopyUrl.Name = "btnCopyUrl";
this.btnCopyUrl.Size = new System.Drawing.Size(94, 26);
this.btnCopyUrl.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -125,6 +127,31 @@ namespace TemuKJD.ToolForms
this.btnCopyUrl.Text = "复制图片地址";
this.btnCopyUrl.Click += new System.EventHandler(this.btnCopyUrl_Click);
//
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClose.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClose.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClose.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClose.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClose.Location = new System.Drawing.Point(584, 3);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(56, 26);
this.btnClose.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClose.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClose.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClose.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnClose.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnClose.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnClose.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnClose.Style.GradientAngle = 90;
this.btnClose.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClose.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClose.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnClose.TabIndex = 481;
this.btnClose.Text = "关闭";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -132,9 +159,9 @@ namespace TemuKJD.ToolForms
this.btnSave.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSave.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSave.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSave.Location = new System.Drawing.Point(584, 3);
this.btnSave.Location = new System.Drawing.Point(366, 4);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(56, 26);
this.btnSave.Size = new System.Drawing.Size(65, 26);
this.btnSave.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSave.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSave.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
@@ -146,9 +173,9 @@ namespace TemuKJD.ToolForms
this.btnSave.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSave.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSave.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSave.TabIndex = 481;
this.btnSave.Text = "关闭";
this.btnSave.Click += new System.EventHandler(this.btnClose_Click);
this.btnSave.TabIndex = 505;
this.btnSave.Text = "保存本地";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// ShowImgForm
//
@@ -177,8 +204,9 @@ namespace TemuKJD.ToolForms
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.PictureBox pictureBox1;
private DevComponents.DotNetBar.PanelEx btnSave;
private DevComponents.DotNetBar.PanelEx btnClose;
private DevComponents.DotNetBar.PanelEx btnCopy;
private DevComponents.DotNetBar.PanelEx btnCopyUrl;
private DevComponents.DotNetBar.PanelEx btnSave;
}
}
+23
View File
@@ -80,5 +80,28 @@ namespace TemuKJD.ToolForms
BaseMsgForm.ShowError("复制图片到剪贴板失败: " + ex.Message);
}
}
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)
{
pictureBox1.Image.Save(sfd.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
}
}