From 11fc88eec9b76d2c2059bb66ee6d34035c404d5f Mon Sep 17 00:00:00 2001 From: yu <1919727607@qq.com> Date: Fri, 30 Oct 2026 14:22:52 +0800 Subject: [PATCH] =?UTF-8?q?style(desktop-picker):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=A1=8C=E9=9D=A2=E9=80=89=E6=8B=A9=E5=99=A8=E7=9A=84=E9=80=8F?= =?UTF-8?q?=E6=98=8E=E6=A0=B7=E5=BC=8F=E5=B9=B6=E6=B7=BB=E5=8A=A0=E8=BE=B9?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将背景色改为 fuchsia 并设置透明键,添加绘制边框的 Paint 事件处理,提升视觉效果 --- resources/desktop-picker.ps1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/desktop-picker.ps1 b/resources/desktop-picker.ps1 index 0d0fbf3..de0be03 100644 --- a/resources/desktop-picker.ps1 +++ b/resources/desktop-picker.ps1 @@ -43,8 +43,18 @@ $hl.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::None $hl.TopMost = $true $hl.ShowInTaskbar = $false $hl.StartPosition = [System.Windows.Forms.FormStartPosition]::Manual -$hl.BackColor = [System.Drawing.Color]::Red -$hl.Opacity = 0.35 +$hl.BackColor = [System.Drawing.Color]::Fuchsia +$hl.TransparencyKey = [System.Drawing.Color]::Fuchsia +$hl.Add_Paint({ + param($sender, $e) + $pen = New-Object System.Drawing.Pen([System.Drawing.Color]::FromArgb(255, 255, 32, 32), 3) + try { + $size = $sender.ClientSize + $e.Graphics.DrawRectangle($pen, 1, 1, ($size.Width - 3), ($size.Height - 3)) + } finally { + $pen.Dispose() + } +}) function Set-ClickThrough($form) { if ($form.IsHandleCreated) { $GWL_EXSTYLE = -20