燈光控制與我的最愛修正

This commit is contained in:
allen.yan 2025-08-07 17:17:02 +08:00
parent 58e4567aee
commit 1c8cee23c9
2 changed files with 31 additions and 26 deletions

View File

@ -350,7 +350,7 @@ namespace DualScreenDemo
if (!FavoritePictureBox.Visible) if (!FavoritePictureBox.Visible)
{ {
ShowImageOnFavoritePictureBox(Path.Combine(serverPath, @"themes\superstar\我的最愛\我的最愛_工作區域.jpg")); ShowImageOnFavoritePictureBox(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\我的最愛_空白介面.png"));
SetFavoritePictureBoxAndButtonsVisibility(true); SetFavoritePictureBoxAndButtonsVisibility(true);
} }
else else

View File

@ -25,8 +25,8 @@ namespace DualScreenDemo
private int OnOffState; private int OnOffState;
private PictureBox pictureBoxToggleLight; private PictureBox pictureBoxToggleLight;
private PictureBox Brightness1; //private PictureBox Brightness1;
private PictureBox Brightness2; //private PictureBox Brightness2;
private void InitializeButtonsForPictureBoxToggleLight() private void InitializeButtonsForPictureBoxToggleLight()
{ {
@ -167,20 +167,21 @@ namespace DualScreenDemo
(sender, e) => SendCommandThroughSerialPort("a2 f8 a4")); (sender, e) => SendCommandThroughSerialPort("a2 f8 a4"));
Brightness1 = new PictureBox { }; //Brightness1 = new PictureBox { };
Brightness1.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\燈光控制_桌燈調光.png")); //Brightness1.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\燈光控制_桌燈調光.png"));
Brightness1.BackgroundImageLayout = ImageLayout.Stretch; //Brightness1.BackgroundImageLayout = ImageLayout.Stretch;
Brightness1.Size = new Size(155, 172); //Brightness1.Size = new Size(155, 172);
Brightness1.Location = new Point(38, 151); //Brightness1.Location = new Point(38, 151);
btnBrightnessUp1 = new Button{ Text = "" }; btnBrightnessUp1 = new Button{ Text = "" };
ConfigureTransButton(btnBrightnessUp1, 1, 1, 116, 40, null); ConfigureTransButton(btnBrightnessUp1, 30, 125, 118, 65, null);
btnBrightnessUp1.MouseDown += (sender, e) => btnBrightnessUp1.MouseDown += (sender, e) =>
{ {
lightControlTimer.Tag = "a2 d9 a4"; lightControlTimer.Tag = "a2 d9 a4";
lightControlTimer.Start(); lightControlTimer.Start();
}; };
//btnBrightnessUp1.BackColor = Color.Red;
btnBrightnessUp1.MouseUp += (sender, e) => btnBrightnessUp1.MouseUp += (sender, e) =>
{ {
@ -188,26 +189,26 @@ namespace DualScreenDemo
}; };
btnBrightnessDown1 = new Button{ Text = "" }; btnBrightnessDown1 = new Button{ Text = "" };
ConfigureTransButton(btnBrightnessDown1, 1, 100, 116, 42, null); ConfigureTransButton(btnBrightnessDown1, 30, 203, 118, 65, null);
btnBrightnessDown1.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 da a4"; lightControlTimer.Start(); }; btnBrightnessDown1.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 da a4"; lightControlTimer.Start(); };
btnBrightnessDown1.MouseUp += (sender, e) => { lightControlTimer.Stop(); }; btnBrightnessDown1.MouseUp += (sender, e) => { lightControlTimer.Stop(); };
//btnBrightnessDown1.BackColor = Color.Red;
//Brightness2 = new PictureBox { };
Brightness2 = new PictureBox { }; //Brightness2.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\燈光控制_層板調光.png"));
Brightness2.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\燈光控制_層板調光.png")); //Brightness2.BackgroundImageLayout = ImageLayout.Stretch;
Brightness2.BackgroundImageLayout = ImageLayout.Stretch; //Brightness2.Size = new Size(155, 172);
Brightness2.Size = new Size(155, 172); //Brightness2.Location = new Point(216, 151);
Brightness2.Location = new Point(216, 151);
btnBrightnessUp2 = new Button{ Text = "" }; btnBrightnessUp2 = new Button{ Text = "" };
ConfigureTransButton(btnBrightnessUp2, 1, 1, 116, 42, null); ConfigureTransButton(btnBrightnessUp2, 163, 125, 118, 65, null);
btnBrightnessUp2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f6 a4"; lightControlTimer.Start(); }; btnBrightnessUp2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f6 a4"; lightControlTimer.Start(); };
btnBrightnessUp2.MouseUp += (sender, e) => { lightControlTimer.Stop(); }; btnBrightnessUp2.MouseUp += (sender, e) => { lightControlTimer.Stop(); };
btnBrightnessDown2 = new Button{ Text = "" }; btnBrightnessDown2 = new Button{ Text = "" };
ConfigureTransButton(btnBrightnessDown2, 1, 100, 116, 42, null); ConfigureTransButton(btnBrightnessDown2, 163, 203, 118, 65, null);
btnBrightnessDown2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f7 a4"; lightControlTimer.Start(); }; btnBrightnessDown2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f7 a4"; lightControlTimer.Start(); };
btnBrightnessDown2.MouseUp += (sender, e) => { lightControlTimer.Stop(); }; btnBrightnessDown2.MouseUp += (sender, e) => { lightControlTimer.Stop(); };
@ -223,12 +224,16 @@ namespace DualScreenDemo
pictureBoxToggleLight.Controls.Add(btnStageLight); pictureBoxToggleLight.Controls.Add(btnStageLight);
pictureBoxToggleLight.Controls.Add(btnShelfLight); pictureBoxToggleLight.Controls.Add(btnShelfLight);
pictureBoxToggleLight.Controls.Add(btnWallLight); pictureBoxToggleLight.Controls.Add(btnWallLight);
Brightness1.Controls.Add(btnBrightnessUp1); //Brightness1.Controls.Add(btnBrightnessUp1);
Brightness1.Controls.Add(btnBrightnessDown1); //Brightness1.Controls.Add(btnBrightnessDown1);
Brightness2.Controls.Add(btnBrightnessUp2); //Brightness2.Controls.Add(btnBrightnessUp2);
Brightness2.Controls.Add(btnBrightnessDown2); //Brightness2.Controls.Add(btnBrightnessDown2);
pictureBoxToggleLight.Controls.Add(Brightness1); pictureBoxToggleLight.Controls.Add(btnBrightnessUp1);
pictureBoxToggleLight.Controls.Add(Brightness2); pictureBoxToggleLight.Controls.Add(btnBrightnessDown1);
pictureBoxToggleLight.Controls.Add(btnBrightnessUp2);
pictureBoxToggleLight.Controls.Add(btnBrightnessDown2);
//pictureBoxToggleLight.Controls.Add(Brightness1);
//pictureBoxToggleLight.Controls.Add(Brightness2);
} }