From ac93c4092a21dbf0fa9cf8b9b1302f2d5d183f61 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 09 六月 2025 20:48:20 +0800
Subject: [PATCH] 修改提示字段

---
 project/人脸识别插件/FaceSdkX64/FaceSdkX64Register/MyOpaqueLayer.cs |  138 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 138 insertions(+), 0 deletions(-)

diff --git "a/project/\344\272\272\350\204\270\350\257\206\345\210\253\346\217\222\344\273\266/FaceSdkX64/FaceSdkX64Register/MyOpaqueLayer.cs" "b/project/\344\272\272\350\204\270\350\257\206\345\210\253\346\217\222\344\273\266/FaceSdkX64/FaceSdkX64Register/MyOpaqueLayer.cs"
new file mode 100644
index 0000000..1f320fe
--- /dev/null
+++ "b/project/\344\272\272\350\204\270\350\257\206\345\210\253\346\217\222\344\273\266/FaceSdkX64/FaceSdkX64Register/MyOpaqueLayer.cs"
@@ -0,0 +1,138 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FaceSdkX64Register
+{
+    [ToolboxBitmap(typeof(MyOpaqueLayer))]
+    public class MyOpaqueLayer : System.Windows.Forms.Control
+    {
+        private bool _transparentBG = true;//鏄惁浣跨敤閫忔槑
+        private int _alpha = 125;//璁剧疆閫忔槑搴�
+
+        private System.ComponentModel.Container components = new System.ComponentModel.Container();
+
+        public MyOpaqueLayer()
+            : this(125, true)
+        {
+        }
+
+        public MyOpaqueLayer(int Alpha, bool IsShowLoadingImage)
+        {
+            SetStyle(System.Windows.Forms.ControlStyles.Opaque, true);
+            base.CreateControl();
+
+            this._alpha = Alpha;
+            if (IsShowLoadingImage)
+            {
+                //Image.FromFile(@"C:\Users\Administrator\Desktop\5-121204193R0-50.gif"); 
+                PictureBox pictureBox_Loading = new PictureBox();
+                //pictureBox_Loading.BackColor = Color.Transparent;
+                //pictureBox_Loading.BackColor = System.Drawing.Color.White;
+
+                Image image = Image.FromStream(new MemoryStream(Properties.Resources.LoadingImg));//v1.10
+
+                pictureBox_Loading.Image = image;
+                pictureBox_Loading.Name = "pictureBox_Loading";
+                pictureBox_Loading.Size = new System.Drawing.Size(48, 48);
+                pictureBox_Loading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+                Point Location = new Point(this.Location.X + (this.Width - pictureBox_Loading.Width) / 2, this.Location.Y + (this.Height - pictureBox_Loading.Height) / 2);//灞呬腑
+                pictureBox_Loading.Location = Location;
+                pictureBox_Loading.Anchor = AnchorStyles.None;
+                this.Controls.Add(pictureBox_Loading);
+            }
+        }
+
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                if (!((components == null)))
+                {
+                    components.Dispose();
+                }
+            }
+            base.Dispose(disposing);
+        }
+
+        /// <summary>
+        /// 鑷畾涔夌粯鍒剁獥浣�
+        /// </summary>
+        /// <param name="e"></param>
+        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
+        {
+            float vlblControlWidth;
+            float vlblControlHeight;
+
+            Pen labelBorderPen;
+            SolidBrush labelBackColorBrush;
+
+            if (_transparentBG)
+            {
+                //v1.10
+
+                Color drawColor = Color.FromArgb(125, 0, 0, 1); //Color.FromArgb(this._alpha, this.BackColor);
+                labelBorderPen = new Pen(drawColor, 0);
+                labelBackColorBrush = new SolidBrush(drawColor);
+            }
+            else
+            {
+                labelBorderPen = new Pen(this.BackColor, 0);
+                labelBackColorBrush = new SolidBrush(this.BackColor);
+            }
+            base.OnPaint(e);
+            vlblControlWidth = this.Size.Width;
+            vlblControlHeight = this.Size.Height;
+            e.Graphics.DrawRectangle(labelBorderPen, 0, 0, vlblControlWidth, vlblControlHeight);
+            e.Graphics.FillRectangle(labelBackColorBrush, 0, 0, vlblControlWidth, vlblControlHeight);
+        }
+
+
+        protected override CreateParams CreateParams//v1.10 
+        {
+            get
+            {
+                CreateParams cp = base.CreateParams;
+                cp.ExStyle |= 0x00000020; //0x20;  // 寮�鍚� WS_EX_TRANSPARENT,浣挎帶浠舵敮鎸侀�忔槑
+                return cp;
+            }
+        }
+
+        /*
+         * [Category("myOpaqueLayer"), Description("鏄惁浣跨敤閫忔槑,榛樿涓篢rue")]
+         * 涓�鑸敤浜庤鏄庝綘鑷畾涔夋帶浠剁殑灞炴�э紙Property锛夈��
+         * Category鐢ㄤ簬璇存槑璇ュ睘鎬у睘浜庡摢涓垎绫伙紝Description鑷劧灏辨槸璇ュ睘鎬х殑鍚箟瑙i噴銆�
+         */
+        [Category("MyOpaqueLayer"), Description("鏄惁浣跨敤閫忔槑,榛樿涓篢rue")]
+        public bool TransparentBG
+        {
+            get
+            {
+                return _transparentBG;
+            }
+            set
+            {
+                _transparentBG = value;
+                this.Invalidate();
+            }
+        }
+
+        [Category("MyOpaqueLayer"), Description("璁剧疆閫忔槑搴�")]
+        public int Alpha
+        {
+            get
+            {
+                return _alpha;
+            }
+            set
+            {
+                _alpha = value;
+                this.Invalidate();
+            }
+        }
+    }
+}

--
Gitblit v1.9.3