mute按鈕邏輯更改

This commit is contained in:
allen.yan 2025-08-06 17:21:45 +08:00
parent 5deeb7843c
commit e6628f123e

View File

@ -6,6 +6,9 @@ using System.Text.RegularExpressions;
using DBObj; using DBObj;
using OverlayFormObj; using OverlayFormObj;
using Timer = System.Windows.Forms.Timer; using Timer = System.Windows.Forms.Timer;
using IniParser.Model;
using IniParser;
using System.Text;
namespace DualScreenDemo namespace DualScreenDemo
{ {
@ -465,7 +468,9 @@ namespace DualScreenDemo
string selectedTheme = ReadSelectedThemePath(); string selectedTheme = ReadSelectedThemePath();
if (!string.IsNullOrEmpty(selectedTheme)) if (!string.IsNullOrEmpty(selectedTheme))
{ {
string backgroundImagePath = Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\0.下方選單_主畫面.jpg"); var data = LoadConfigData();
string backgroundImagePath = Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\0.下方選單_主畫面.jpg");
try try
{ {
using (Image originalImage = Image.FromFile(backgroundImagePath)) using (Image originalImage = Image.FromFile(backgroundImagePath))
@ -996,6 +1001,8 @@ namespace DualScreenDemo
#region #region
private void InitializeOtherControls() private void InitializeOtherControls()
{ {
var data = LoadConfigData();
InitializeButton(ref newSongAlertButton, ref newSongAlertNormalBackground, ref newSongAlertActiveBackground, "newSongAlertButton", 20, 98, 105, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_新歌快報(未按).png", NewSongAlertButton_Click); InitializeButton(ref newSongAlertButton, ref newSongAlertNormalBackground, ref newSongAlertActiveBackground, "newSongAlertButton", 20, 98, 105, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_新歌快報(未按).png", NewSongAlertButton_Click);
InitializeButton(ref hotPlayButton, ref hotPlayNormalBackground, ref hotPlayActiveBackground, "hotPlayButton", 137, 98, 106, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_熱門排行(未按).png", HotPlayButton_Click); InitializeButton(ref hotPlayButton, ref hotPlayNormalBackground, ref hotPlayActiveBackground, "hotPlayButton", 137, 98, 106, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_熱門排行(未按).png", HotPlayButton_Click);
@ -1013,9 +1020,9 @@ namespace DualScreenDemo
serviceBellButton = new Button { Text = "" }; serviceBellButton = new Button { Text = "" };
ConfigureButton(serviceBellButton, 843, 98, 107, 120, ConfigureButton(serviceBellButton, 843, 98, 107, 120,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(未按).png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(未按).png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(未按).png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(未按).png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(已按).png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(已按).png")),
(sender, e) => OnServiceBellButtonClick(sender, e)); (sender, e) => OnServiceBellButtonClick(sender, e));
@ -1031,72 +1038,72 @@ namespace DualScreenDemo
mobileSongRequestButton = new Button { Text = "" }; mobileSongRequestButton = new Button { Text = "" };
mobileSongRequestButton.Name = "mobileSongRequestButton"; mobileSongRequestButton.Name = "mobileSongRequestButton";
ConfigureButton(mobileSongRequestButton, 1198, 629, 223, 88, ConfigureButton(mobileSongRequestButton, 1198, 629, 223, 88,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")),
MobileSongRequestButton_Click); MobileSongRequestButton_Click);
qieGeButton = new Button { Text = "" }; qieGeButton = new Button { Text = "" };
qieGeButton.Name = "qieGeButton"; qieGeButton.Name = "qieGeButton";
ConfigureButton(qieGeButton, 20, 738, 92, 147, ConfigureButton(qieGeButton, 20, 738, 92, 147,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")),
(sender, e) => videoPlayerForm.PlayNextSong()); (sender, e) => videoPlayerForm.PlayNextSong());
musicUpButton = new Button { Text = "" }; musicUpButton = new Button { Text = "" };
musicUpButton.Name = "musicUpButton"; musicUpButton.Name = "musicUpButton";
ConfigureButton(musicUpButton, 128, 738, 93, 62, ConfigureButton(musicUpButton, 128, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂+.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_音樂+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂+.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_音樂+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_音樂++.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"] , "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_音樂++.png")),
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑", "a2 b3 a4"); }); (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑", "a2 b3 a4"); });
musicDownButton = new Button { Text = "" }; musicDownButton = new Button { Text = "" };
musicDownButton.Name = "musicDownButton"; musicDownButton.Name = "musicDownButton";
ConfigureButton(musicDownButton, 128, 823, 93, 62, ConfigureButton(musicDownButton, 128, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂-.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_音樂-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂-.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_音樂-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_音樂--.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_音樂--.png")),
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓", "a2 b4 a4"); }); (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓", "a2 b4 a4"); });
micUpButton = new Button { Text = "" }; micUpButton = new Button { Text = "" };
micUpButton.Name = "micUpButton"; micUpButton.Name = "micUpButton";
ConfigureButton(micUpButton, 238, 738, 93, 62, ConfigureButton(micUpButton, 238, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風+.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風+.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_麥克風++.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_麥克風++.png")),
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑", "a2 b5 a4"); }); (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑", "a2 b5 a4"); });
micDownButton = new Button { Text = "" }; micDownButton = new Button { Text = "" };
micDownButton.Name = "micDownButton"; micDownButton.Name = "micDownButton";
ConfigureButton(micDownButton, 238, 823, 93, 62, ConfigureButton(micDownButton, 238, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風-.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風-.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_麥克風--.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_麥克風--.png")),
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓", "a2 b6 a4"); }); (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓", "a2 b6 a4"); });
originalSongButton = new Button { Text = "" }; originalSongButton = new Button { Text = "" };
originalSongButton.Name = "originalSongButton"; originalSongButton.Name = "originalSongButton";
ConfigureButton(originalSongButton, 347, 738, 93, 62, ConfigureButton(originalSongButton, 347, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")),
OriginalSongButton_Click); OriginalSongButton_Click);
replayButton = new Button { Text = "" }; replayButton = new Button { Text = "" };
replayButton.Name = "replayButton"; replayButton.Name = "replayButton";
ConfigureButton(replayButton, 347, 823, 93, 62, ConfigureButton(replayButton, 347, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")),
ReplayButton_Click); ReplayButton_Click);
@ -1104,9 +1111,9 @@ namespace DualScreenDemo
Text = "", Text = "",
Name = "pauseButton" }; Name = "pauseButton" };
ConfigureButton(pauseButton, 456, 738, 93, 62, ConfigureButton(pauseButton, 456, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")),
PauseButton_Click); PauseButton_Click);
@ -1117,144 +1124,144 @@ namespace DualScreenDemo
Visible = false Visible = false
}; };
ConfigureButton(playButton, 456, 738, 93, 62, ConfigureButton(playButton, 456, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")),
PlayButton_Click); PlayButton_Click);
muteButton = new Button { Text = "" }; muteButton = new Button { Text = "" };
muteButton.Name = "muteButton"; muteButton.Name = "muteButton";
ConfigureButton(muteButton, 456, 823, 93, 62, ConfigureButton(muteButton, 456, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")),
MuteUnmuteButton_Click); MuteUnmuteButton_Click);
maleKeyButton = new Button { Text = "" }; maleKeyButton = new Button { Text = "" };
maleKeyButton.Name = "maleKeyButton"; maleKeyButton.Name = "maleKeyButton";
ConfigureButton(maleKeyButton, 564, 738, 93, 62, ConfigureButton(maleKeyButton, 564, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"] , "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")),
MaleKeyButton_Click); MaleKeyButton_Click);
femaleKeyButton = new Button { Text = "" }; femaleKeyButton = new Button { Text = "" };
femaleKeyButton.Name = "femaleKeyButton"; femaleKeyButton.Name = "femaleKeyButton";
ConfigureButton(femaleKeyButton, 565, 823, 93, 62, ConfigureButton(femaleKeyButton, 565, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")),
FemaleKeyButton_Click); FemaleKeyButton_Click);
standardKeyButton = new Button { Text = "" }; standardKeyButton = new Button { Text = "" };
standardKeyButton.Name = "standardKeyButton"; standardKeyButton.Name = "standardKeyButton";
ConfigureButton(standardKeyButton, 674, 738, 93, 62, ConfigureButton(standardKeyButton, 674, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")),
StandardKeyButton_Click); StandardKeyButton_Click);
soundEffectButton = new Button { Text = "" }; soundEffectButton = new Button { Text = "" };
soundEffectButton.Name = "soundEffectButton"; soundEffectButton.Name = "soundEffectButton";
ConfigureButton(soundEffectButton, 674, 823, 93, 62, ConfigureButton(soundEffectButton, 674, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")),
SoundEffectButton_Click); SoundEffectButton_Click);
pitchUpButton = new Button { Text = "" }; pitchUpButton = new Button { Text = "" };
pitchUpButton.Name = "pitchUpButton"; pitchUpButton.Name = "pitchUpButton";
ConfigureButton(pitchUpButton, 784, 738, 93, 62, ConfigureButton(pitchUpButton, 784, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")),
PitchUpButton_Click); PitchUpButton_Click);
pitchDownButton = new Button { Text = "" }; pitchDownButton = new Button { Text = "" };
pitchDownButton.Name = "pitchDownButton"; pitchDownButton.Name = "pitchDownButton";
ConfigureButton(pitchDownButton, 784, 823, 93, 62, ConfigureButton(pitchDownButton, 784, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")),
PitchDownButton_Click); PitchDownButton_Click);
syncScreenButton = new Button { Text = "" }; syncScreenButton = new Button { Text = "" };
syncScreenButton.Name = "syncScreenButton"; syncScreenButton.Name = "syncScreenButton";
ConfigureButton(syncScreenButton, 893, 736, 92, 149, ConfigureButton(syncScreenButton, 893, 736, 92, 149,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")),
SyncScreenButton_Click); SyncScreenButton_Click);
toggleLightButton = new Button { Text = "" }; toggleLightButton = new Button { Text = "" };
toggleLightButton.Name = "toggleLightButton"; toggleLightButton.Name = "toggleLightButton";
ConfigureButton(toggleLightButton, 1002, 736, 92, 149, ConfigureButton(toggleLightButton, 1002, 736, 92, 149,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")),
ToggleLightButton_Click); ToggleLightButton_Click);
btnPreviousPage = new Button { Text = "" }; btnPreviousPage = new Button { Text = "" };
btnPreviousPage.Name = "btnPreviousPageButton"; btnPreviousPage.Name = "btnPreviousPageButton";
ConfigureButton(btnPreviousPage, 1110, 738, 93, 62, ConfigureButton(btnPreviousPage, 1110, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")),
PreviousPageButton_Click); PreviousPageButton_Click);
btnReturn = new Button { Text = "" }; btnReturn = new Button { Text = "" };
btnReturn.Name = "btnReturn"; btnReturn.Name = "btnReturn";
ConfigureButton(btnReturn, 1220, 738, 93, 62, ConfigureButton(btnReturn, 1220, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")),
ShouYeButton_Click); ShouYeButton_Click);
btnNextPage = new Button { Text = "" }; btnNextPage = new Button { Text = "" };
btnNextPage.Name = "btnNextPage"; btnNextPage.Name = "btnNextPage";
ConfigureButton(btnNextPage, 1330, 738, 93, 62, ConfigureButton(btnNextPage, 1330, 738, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")),
NextPageButton_Click); NextPageButton_Click);
btnApplause = new Button { Text = "" }; btnApplause = new Button { Text = "" };
btnApplause.Name = "btnApplause"; btnApplause.Name = "btnApplause";
ConfigureButton(btnApplause, 1110, 823, 93, 62, ConfigureButton(btnApplause, 1110, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"] , "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")),
ApplauseButton_Click); ApplauseButton_Click);
btnSimplifiedChinese = new Button { Text = "" }; btnSimplifiedChinese = new Button { Text = "" };
btnSimplifiedChinese.Name = "btnSimplifiedChinese"; btnSimplifiedChinese.Name = "btnSimplifiedChinese";
ConfigureButton(btnSimplifiedChinese, 1330, 823, 93, 62, ConfigureButton(btnSimplifiedChinese, 1330, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")),
SimplifiedChineseButton_Click); SimplifiedChineseButton_Click);
btnTraditionalChinese = new Button { Text = "" }; btnTraditionalChinese = new Button { Text = "" };
btnTraditionalChinese.Name = "btnTraditionalChinese"; btnTraditionalChinese.Name = "btnTraditionalChinese";
ConfigureButton(btnTraditionalChinese, 1220, 823, 93, 62, ConfigureButton(btnTraditionalChinese, 1220, 823, 93, 62,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")),
TraditionalChineseButton_Click); TraditionalChineseButton_Click);
/* 關閉應用程式按鈕*/ /* 關閉應用程式按鈕*/
@ -1269,10 +1276,12 @@ namespace DualScreenDemo
private void InitializeButton(ref Button button, ref Bitmap normalBackground, ref Bitmap activeBackground, string buttonName, int x, int y, int width, int height, string imagePath, EventHandler clickEventHandler) private void InitializeButton(ref Button button, ref Bitmap normalBackground, ref Bitmap activeBackground, string buttonName, int x, int y, int width, int height, string imagePath, EventHandler clickEventHandler)
{ {
var data = LoadConfigData();
button = new Button { Text = "", Name = buttonName }; button = new Button { Text = "", Name = buttonName };
ResizeAndPositionButton(button, x, y, width, height); ResizeAndPositionButton(button, x, y, width, height);
Rectangle buttonCropArea = new Rectangle(x, y, width, height); Rectangle buttonCropArea = new Rectangle(x, y, width, height);
normalBackground = new Bitmap(Path.Combine(Application.StartupPath, imagePath)); normalBackground = new Bitmap(Path.Combine(data["ImageSrc"]["path"], imagePath));
activeBackground = mouseDownImage.Clone(buttonCropArea, mouseDownImage.PixelFormat); activeBackground = mouseDownImage.Clone(buttonCropArea, mouseDownImage.PixelFormat);
button.BackgroundImage = normalBackground; button.BackgroundImage = normalBackground;
button.BackgroundImageLayout = ImageLayout.Stretch; button.BackgroundImageLayout = ImageLayout.Stretch;
@ -1285,31 +1294,7 @@ namespace DualScreenDemo
this.Controls.Add(button); this.Controls.Add(button);
} }
private void InitializeButton(
ref Button button,
string buttonName,
int x, int y,
int width, int height,
Rectangle cropArea,
Bitmap normalStateImage,
EventHandler clickEventHandler)
{
button = new Button { Text = "", Name = buttonName };
ResizeAndPositionButton(button, x, y, width, height);
//button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
button.BackgroundImage = normalStateImage;
//button.BackColor = Color.Transparent;
button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0;
//button.FlatAppearance.MouseOverBackColor = Color.Transparent;
//button.FlatAppearance.MouseDownBackColor = Color.Transparent;
if (clickEventHandler != null)
{
button.Click += clickEventHandler;
}
this.Controls.Add(button);
}
private void InitializeMultiPagePanel() private void InitializeMultiPagePanel()
{ {
// 獲取螢幕尺寸 // 獲取螢幕尺寸
@ -1340,6 +1325,7 @@ namespace DualScreenDemo
public void Label_Click(object sender, EventArgs e) public void Label_Click(object sender, EventArgs e)
{ {
var data = LoadConfigData();
var label = sender as Label; var label = sender as Label;
if (label != null && label.Tag is SongData) if (label != null && label.Tag is SongData)
{ {
@ -1348,7 +1334,7 @@ namespace DualScreenDemo
this.DoubleBuffered = true; this.DoubleBuffered = true;
this.SuspendLayout(); this.SuspendLayout();
DrawTextOnVodScreenPictureBox(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\歌曲點播_空白介面.png"), currentSelectedSong); DrawTextOnVodScreenPictureBox(Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\button\3.介面\歌曲點播_空白介面.png"), currentSelectedSong);
SetVodScreenPictureBoxAndButtonsVisibility(true); SetVodScreenPictureBoxAndButtonsVisibility(true);
this.ResumeLayout(true); this.ResumeLayout(true);
} }
@ -1425,88 +1411,89 @@ namespace DualScreenDemo
private void LoadImages() private void LoadImages()
{ {
var data = LoadConfigData();
string selectedThemePath = ReadSelectedThemePath(); string selectedThemePath = ReadSelectedThemePath();
string basePath = Path.Combine(Application.StartupPath, selectedThemePath); string basePath = Path.Combine(data["ImageSrc"]["path"], selectedThemePath);
int targetWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; int targetWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
int targetHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height; int targetHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
normalStateImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\0.下方選單_主畫面.jpg")); normalStateImage = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\0.下方選單_主畫面.jpg"));
resizedNormalStateImage = ResizeImage(normalStateImage, targetWidth, targetHeight); resizedNormalStateImage = ResizeImage(normalStateImage, targetWidth, targetHeight);
mouseOverImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\0.主選單_已按.jpg")); mouseOverImage = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\0.主選單_已按.jpg"));
resizedMouseOverImage = ResizeImage(mouseOverImage, targetWidth, targetHeight); resizedMouseOverImage = ResizeImage(mouseOverImage, targetWidth, targetHeight);
mouseDownImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\0.主選單_已按.jpg")); mouseDownImage = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\0.主選單_已按.jpg"));
resizedMouseDownImage = ResizeImage(mouseDownImage, targetWidth, targetHeight); resizedMouseDownImage = ResizeImage(mouseDownImage, targetWidth, targetHeight);
normalStateImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\1.新歌快報_未按.jpg")); normalStateImageNewSongAlert = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\1.新歌快報_未按.jpg"));
resizedNormalStateImageForNewSongAlert = ResizeImage(normalStateImageNewSongAlert, targetWidth, targetHeight); resizedNormalStateImageForNewSongAlert = ResizeImage(normalStateImageNewSongAlert, targetWidth, targetHeight);
mouseOverImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg")); mouseOverImageNewSongAlert = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg"));
resizedMouseOverImageForNewSongAlert = ResizeImage(mouseOverImageNewSongAlert, targetWidth, targetHeight); resizedMouseOverImageForNewSongAlert = ResizeImage(mouseOverImageNewSongAlert, targetWidth, targetHeight);
mouseDownImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg")); mouseDownImageNewSongAlert = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg"));
resizedMouseDownImageForNewSongAlert = ResizeImage(mouseDownImageNewSongAlert, targetWidth, targetHeight); resizedMouseDownImageForNewSongAlert = ResizeImage(mouseDownImageNewSongAlert, targetWidth, targetHeight);
normalStateImageArtistQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\3.歌星查詢_未按.jpg")); normalStateImageArtistQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\3.歌星查詢_未按.jpg"));
resizedNormalStateImageForArtistQuery = ResizeImage(normalStateImageArtistQuery, targetWidth, targetHeight); resizedNormalStateImageForArtistQuery = ResizeImage(normalStateImageArtistQuery, targetWidth, targetHeight);
mouseOverImageArtistQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg")); mouseOverImageArtistQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg"));
resizedMouseOverImageForArtistQuery = ResizeImage(mouseOverImageArtistQuery, targetWidth, targetHeight); resizedMouseOverImageForArtistQuery = ResizeImage(mouseOverImageArtistQuery, targetWidth, targetHeight);
mouseDownImageArtistQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg")); mouseDownImageArtistQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg"));
resizedMouseDownImageForArtistQuery = ResizeImage(mouseDownImageArtistQuery, targetWidth, targetHeight); resizedMouseDownImageForArtistQuery = ResizeImage(mouseDownImageArtistQuery, targetWidth, targetHeight);
normalStateImageSongQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\4.歌名查詢_未按.jpg")); normalStateImageSongQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"] , "themes\\superstar\\主畫面\\4.歌名查詢_未按.jpg"));
resizedNormalStateImageForSongQuery = ResizeImage(normalStateImageSongQuery, targetWidth, targetHeight); resizedNormalStateImageForSongQuery = ResizeImage(normalStateImageSongQuery, targetWidth, targetHeight);
mouseOverImageSongQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg")); mouseOverImageSongQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg"));
resizedMouseOverImageForSongQuery = ResizeImage(mouseOverImageSongQuery, targetWidth, targetHeight); resizedMouseOverImageForSongQuery = ResizeImage(mouseOverImageSongQuery, targetWidth, targetHeight);
mouseDownImageSongQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg")); mouseDownImageSongQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg"));
resizedMouseDownImageForSongQuery = ResizeImage(mouseDownImageSongQuery, targetWidth, targetHeight); resizedMouseDownImageForSongQuery = ResizeImage(mouseDownImageSongQuery, targetWidth, targetHeight);
normalStateImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\5.語別查詢_未按.jpg")); normalStateImageLanguageQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\5.語別查詢_未按.jpg"));
resizedNormalStateImageForLanguageQuery = ResizeImage(normalStateImageLanguageQuery, targetWidth, targetHeight); resizedNormalStateImageForLanguageQuery = ResizeImage(normalStateImageLanguageQuery, targetWidth, targetHeight);
mouseOverImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg")); mouseOverImageLanguageQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg"));
resizedMouseOverImageForLanguageQuery = ResizeImage(mouseOverImageLanguageQuery, targetWidth, targetHeight); resizedMouseOverImageForLanguageQuery = ResizeImage(mouseOverImageLanguageQuery, targetWidth, targetHeight);
mouseDownImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg")); mouseDownImageLanguageQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg"));
resizedMouseDownImageForLanguageQuery = ResizeImage(mouseDownImageLanguageQuery, targetWidth, targetHeight); resizedMouseDownImageForLanguageQuery = ResizeImage(mouseDownImageLanguageQuery, targetWidth, targetHeight);
normalStateImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\7.類別查詢_未按.jpg")); normalStateImageCategoryQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\7.類別查詢_未按.jpg"));
resizedNormalStateImageForCategoryQuery = ResizeImage(normalStateImageCategoryQuery, targetWidth, targetHeight); resizedNormalStateImageForCategoryQuery = ResizeImage(normalStateImageCategoryQuery, targetWidth, targetHeight);
mouseOverImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg")); mouseOverImageCategoryQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg"));
resizedMouseOverImageForCategoryQuery = ResizeImage(mouseOverImageCategoryQuery, targetWidth, targetHeight); resizedMouseOverImageForCategoryQuery = ResizeImage(mouseOverImageCategoryQuery, targetWidth, targetHeight);
mouseDownImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg")); mouseDownImageCategoryQuery = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg"));
resizedMouseDownImageForCategoryQuery = ResizeImage(mouseDownImageCategoryQuery, targetWidth, targetHeight); resizedMouseDownImageForCategoryQuery = ResizeImage(mouseDownImageCategoryQuery, targetWidth, targetHeight);
normalStateImageForPromotionsAndMenu = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\555021.jpg")); normalStateImageForPromotionsAndMenu = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\555021.jpg"));
resizedNormalStateImageForPromotionsAndMenu = ResizeImage(normalStateImageForPromotionsAndMenu, targetWidth, targetHeight); resizedNormalStateImageForPromotionsAndMenu = ResizeImage(normalStateImageForPromotionsAndMenu, targetWidth, targetHeight);
try try
{ {
string imagePath = Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\選單內介面_同步畫面.jpg"); string imagePath = Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\選單內介面_同步畫面.jpg");
if (File.Exists(imagePath)) if (File.Exists(imagePath))
{ {
@ -1526,17 +1513,17 @@ namespace DualScreenDemo
} }
normalStateImageForSceneSoundEffects = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\555022.jpg")); normalStateImageForSceneSoundEffects = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\555022.jpg"));
resizedNormalStateImageForSceneSoundEffects = ResizeImage(normalStateImageForSceneSoundEffects, targetWidth, targetHeight); resizedNormalStateImageForSceneSoundEffects = ResizeImage(normalStateImageForSceneSoundEffects, targetWidth, targetHeight);
normalStateImageHotSong = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\2.熱門排行_未按.jpg")); normalStateImageHotSong = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\2.熱門排行_未按.jpg"));
resizedNormalStateImageForHotSong = ResizeImage(normalStateImageHotSong, targetWidth, targetHeight); resizedNormalStateImageForHotSong = ResizeImage(normalStateImageHotSong, targetWidth, targetHeight);
mouseDownImageHotSong = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\2.熱門排行_已按.jpg")); mouseDownImageHotSong = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\2.熱門排行_已按.jpg"));
resizedMouseDownImageForHotSong = ResizeImage(mouseDownImageHotSong, targetWidth, targetHeight); resizedMouseDownImageForHotSong = ResizeImage(mouseDownImageHotSong, targetWidth, targetHeight);
normalStateImageForLightControl = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\選單內介面_燈光控制.jpg")); normalStateImageForLightControl = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\選單內介面_燈光控制.jpg"));
resizedNormalStateImageForLightControl = ResizeImage(normalStateImageForLightControl, targetWidth, targetHeight); resizedNormalStateImageForLightControl = ResizeImage(normalStateImageForLightControl, targetWidth, targetHeight);
} }
@ -1669,6 +1656,8 @@ namespace DualScreenDemo
private void DeliciousFoodButton_Click(object sender, EventArgs e) private void DeliciousFoodButton_Click(object sender, EventArgs e)
{ {
var data = LoadConfigData();
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground; newSongAlertButton.BackgroundImage = newSongAlertNormalBackground;
hotPlayButton.BackgroundImage = hotPlayNormalBackground; hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground; singerSearchButton.BackgroundImage = singerSearchNormalBackground;
@ -1679,7 +1668,7 @@ namespace DualScreenDemo
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground; promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_美味菜單(已按).png")); deliciousFoodButton.BackgroundImage = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_美味菜單(已按).png"));
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);
@ -1872,11 +1861,11 @@ namespace DualScreenDemo
private void MuteUnmuteButton_Click(object sender, EventArgs e) private void MuteUnmuteButton_Click(object sender, EventArgs e)
{ {
SetHotSongButtonsVisibility(false); //SetHotSongButtonsVisibility(false);
SetNewSongButtonsVisibility(false); //SetNewSongButtonsVisibility(false);
SetSingerSearchButtonsVisibility(false); //SetSingerSearchButtonsVisibility(false);
SetSongSearchButtonsVisibility(false); //SetSongSearchButtonsVisibility(false);
SetPictureBoxToggleLightAndButtonsVisibility(false); //SetPictureBoxToggleLightAndButtonsVisibility(false);
if (videoPlayerForm.isMuted) if (videoPlayerForm.isMuted)
{ {
@ -2157,9 +2146,11 @@ namespace DualScreenDemo
// 添加載入按鈕圖片的方法 // 添加載入按鈕圖片的方法
private Image LoadButtonImage(string imageName) private Image LoadButtonImage(string imageName)
{ {
var data = LoadConfigData();
try try
{ {
string filePath = Path.Combine(Application.StartupPath, "themes", "superstar", "ButtonImages", imageName); string filePath = Path.Combine(data["ImageSrc"]["path"], "themes", "superstar", "ButtonImages", imageName);
if (File.Exists(filePath)) if (File.Exists(filePath))
{ {
return Image.FromFile(filePath); return Image.FromFile(filePath);
@ -2179,9 +2170,11 @@ namespace DualScreenDemo
/// <returns></returns> /// <returns></returns>
private Image LoadSendOffImage() private Image LoadSendOffImage()
{ {
var data = LoadConfigData();
try try
{ {
string filePath = Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\選單內介面_送客畫面.jpg"); string filePath = Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\主畫面\\選單內介面_送客畫面.jpg");
if (File.Exists(filePath)) if (File.Exists(filePath))
{ {
return Image.FromFile(filePath); return Image.FromFile(filePath);
@ -2224,6 +2217,8 @@ namespace DualScreenDemo
private void OrderedSongsButton_Click(object sender, EventArgs e) private void OrderedSongsButton_Click(object sender, EventArgs e)
{ {
var data= LoadConfigData();
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground; newSongAlertButton.BackgroundImage = newSongAlertNormalBackground;
hotPlayButton.BackgroundImage = hotPlayNormalBackground; hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground; singerSearchButton.BackgroundImage = singerSearchNormalBackground;
@ -2231,7 +2226,7 @@ namespace DualScreenDemo
languageSearchButton.BackgroundImage = languageSearchNormalBackground; languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground; groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_已點歌曲(已按).png")); orderedSongsButton.BackgroundImage = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_已點歌曲(已按).png"));
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground; promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground; deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
@ -2268,6 +2263,7 @@ namespace DualScreenDemo
multiPagePanel.LoadPlayedSongs(List); multiPagePanel.LoadPlayedSongs(List);
} }
#region Visible屬性設定
private void SetUIVisible(Control parent) private void SetUIVisible(Control parent)
{ {
foreach (Control ctrl in parent.Controls) foreach (Control ctrl in parent.Controls)
@ -2295,5 +2291,25 @@ namespace DualScreenDemo
} }
} }
} }
#endregion
/// <summary>
/// 從設定檔 (config.ini) 載入 INI 設定數據。
/// </summary>
/// <returns>回傳解析後的 INI 設定數據 (IniData)。</returns>
private IniData LoadConfigData()
{
var parser = new FileIniDataParser();
string iniFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.ini");
// 使用 UTF-8 讀取 INI 檔案並解析內容
using (var reader = new StreamReader(iniFilePath, Encoding.UTF8))
{
return parser.ReadData(reader);
}
}
} }
} }