圖片來源路徑自本地移至線上

This commit is contained in:
allen.yan 2025-08-06 18:02:14 +08:00
parent 57e0f6ea85
commit f97501c1af
9 changed files with 178 additions and 185 deletions

View File

@ -45,6 +45,8 @@ namespace DualScreenDemo
favoriteNumberButton = new Button[10]; favoriteNumberButton = new Button[10];
var data=LoadConfigData();
for (int i = 0; i < favoriteNumberButton.Length; i++) for (int i = 0; i < favoriteNumberButton.Length; i++)
{ {
favoriteNumberButton[i] = new Button(); favoriteNumberButton[i] = new Button();
@ -53,7 +55,7 @@ namespace DualScreenDemo
string fileName = (i+1).ToString(); string fileName = (i+1).ToString();
string filePath = Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\我的最愛_" + fileName + ".png"); string filePath = Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\button\3.介面\我的最愛_" + fileName + ".png");
favoriteNumberButton[i].BackgroundImage = Image.FromFile(filePath); favoriteNumberButton[i].BackgroundImage = Image.FromFile(filePath);
favoriteNumberButton[i].BackgroundImageLayout = ImageLayout.Stretch; favoriteNumberButton[i].BackgroundImageLayout = ImageLayout.Stretch;
favoriteNumberButton[i].FlatStyle = FlatStyle.Flat; favoriteNumberButton[i].FlatStyle = FlatStyle.Flat;
@ -85,7 +87,7 @@ namespace DualScreenDemo
Name = "enterFavoriteButton" Name = "enterFavoriteButton"
}; };
ResizeAndPositionButton(enterFavoriteButton, 832, 657, 70, 65); ResizeAndPositionButton(enterFavoriteButton, 832, 657, 70, 65);
enterFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\我的最愛_確認.png")); enterFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\button\3.介面\我的最愛_確認.png"));
enterFavoriteButton.BackgroundImageLayout = ImageLayout.Stretch; enterFavoriteButton.BackgroundImageLayout = ImageLayout.Stretch;
enterFavoriteButton.FlatStyle = FlatStyle.Flat; enterFavoriteButton.FlatStyle = FlatStyle.Flat;
enterFavoriteButton.FlatAppearance.BorderSize = 0; enterFavoriteButton.FlatAppearance.BorderSize = 0;
@ -100,7 +102,7 @@ namespace DualScreenDemo
Name = "newFavoriteButton" Name = "newFavoriteButton"
}; };
ResizeAndPositionButton(newFavoriteButton, 916, 657, 70, 65); ResizeAndPositionButton(newFavoriteButton, 916, 657, 70, 65);
newFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\我的最愛_新建.png")); newFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\button\3.介面\我的最愛_新建.png"));
newFavoriteButton.BackgroundImageLayout = ImageLayout.Stretch; newFavoriteButton.BackgroundImageLayout = ImageLayout.Stretch;
newFavoriteButton.FlatStyle = FlatStyle.Flat; newFavoriteButton.FlatStyle = FlatStyle.Flat;
newFavoriteButton.FlatAppearance.BorderSize = 0; newFavoriteButton.FlatAppearance.BorderSize = 0;
@ -115,7 +117,7 @@ namespace DualScreenDemo
Name = "refillFavoriteButton" Name = "refillFavoriteButton"
}; };
ResizeAndPositionButton(refillFavoriteButton, 999, 657, 70, 65); ResizeAndPositionButton(refillFavoriteButton, 999, 657, 70, 65);
refillFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\我的最愛_重填.png")); refillFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\button\3.介面\我的最愛_重填.png"));
refillFavoriteButton.BackgroundImageLayout = ImageLayout.Stretch; refillFavoriteButton.BackgroundImageLayout = ImageLayout.Stretch;
refillFavoriteButton.FlatStyle = FlatStyle.Flat; refillFavoriteButton.FlatStyle = FlatStyle.Flat;
refillFavoriteButton.FlatAppearance.BorderSize = 0; refillFavoriteButton.FlatAppearance.BorderSize = 0;
@ -130,7 +132,7 @@ namespace DualScreenDemo
Name = "closeFavoriteButton" Name = "closeFavoriteButton"
}; };
ResizeAndPositionButton(closeFavoriteButton, 1083, 657, 70, 65); ResizeAndPositionButton(closeFavoriteButton, 1083, 657, 70, 65);
closeFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\我的最愛_關閉.png")); closeFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\button\3.介面\我的最愛_關閉.png"));
closeFavoriteButton.BackgroundImageLayout = ImageLayout.Stretch; closeFavoriteButton.BackgroundImageLayout = ImageLayout.Stretch;
closeFavoriteButton.FlatStyle = FlatStyle.Flat; closeFavoriteButton.FlatStyle = FlatStyle.Flat;
closeFavoriteButton.FlatAppearance.BorderSize = 0; closeFavoriteButton.FlatAppearance.BorderSize = 0;
@ -329,6 +331,8 @@ namespace DualScreenDemo
private void MyFavoritesButton_Click(object sender, EventArgs e) private void MyFavoritesButton_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;
@ -337,7 +341,7 @@ namespace DualScreenDemo
groupSearchButton.BackgroundImage = groupSearchNormalBackground; groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_我的最愛(已按).png")); myFavoritesButton.BackgroundImage = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_我的最愛(已按).png"));
promotionsButton.BackgroundImage = promotionsNormalBackground; promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground; deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
@ -346,7 +350,7 @@ namespace DualScreenDemo
if (!FavoritePictureBox.Visible) if (!FavoritePictureBox.Visible)
{ {
ShowImageOnFavoritePictureBox(Path.Combine(Application.StartupPath, @"themes\superstar\我的最愛\我的最愛_工作區域.jpg")); ShowImageOnFavoritePictureBox(Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\我的最愛\我的最愛_工作區域.jpg"));
SetFavoritePictureBoxAndButtonsVisibility(true); SetFavoritePictureBoxAndButtonsVisibility(true);
} }
else else

View File

@ -1,5 +1,8 @@
using DBObj; using DBObj;
using IniParser.Model;
using IniParser;
using System.IO; using System.IO;
using System.Text;
namespace DualScreenDemo namespace DualScreenDemo
{ {
@ -420,12 +423,15 @@ namespace DualScreenDemo
int songWidth = (int)(this.Width * SongWidth); int songWidth = (int)(this.Width * SongWidth);
int artistWidth = (int)(this.Width * ArtistWidth); int artistWidth = (int)(this.Width * ArtistWidth);
int artistX = songX + songWidth + 10; int artistX = songX + songWidth + 10;
var data = LoadConfigData();
// 添加人聲標籤 // 添加人聲標籤
if (song.getHumanVoice() == 1) if (song.getHumanVoice() == 1)
{ {
PictureBox icon = new PictureBox() PictureBox icon = new PictureBox()
{ {
Image = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\其他符號_人聲.png")), Image = Image.FromFile(Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\button\3.介面\其他符號_人聲.png")),
SizeMode = PictureBoxSizeMode.Zoom, SizeMode = PictureBoxSizeMode.Zoom,
Size = new Size(30, 30), Size = new Size(30, 30),
Location = new Point(songX + 5, y + 8) Location = new Point(songX + 5, y + 8)
@ -511,8 +517,19 @@ namespace DualScreenDemo
artistLabel.BringToFront(); artistLabel.BringToFront();
songLabel.TextAlign = ContentAlignment.TopLeft; songLabel.TextAlign = ContentAlignment.TopLeft;
} }
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);
}
}
} }
} }
} }

View File

@ -19,6 +19,8 @@ namespace DualScreenDemo
int baseY = Screen.PrimaryScreen.Bounds.Height - 120; int baseY = Screen.PrimaryScreen.Bounds.Height - 120;
int buttonSpacing = 90; int buttonSpacing = 90;
var data = LoadConfigData();
// 共用的按鈕設置 // 共用的按鈕設置
void ConfigurePromotionButton(Button button, string imagePath, Point location) void ConfigurePromotionButton(Button button, string imagePath, Point location)
{ {
@ -30,7 +32,7 @@ namespace DualScreenDemo
button.FlatAppearance.MouseDownBackColor = Color.Transparent; button.FlatAppearance.MouseDownBackColor = Color.Transparent;
button.Location = location; button.Location = location;
using (var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(Application.StartupPath, imagePath)))) using (var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(data["ImageSrc"]["path"], imagePath))))
{ {
var image = Image.FromStream(stream); var image = Image.FromStream(stream);
if (image.PixelFormat != System.Drawing.Imaging.PixelFormat.Format32bppArgb) if (image.PixelFormat != System.Drawing.Imaging.PixelFormat.Format32bppArgb)
@ -78,6 +80,8 @@ namespace DualScreenDemo
private void promotionsButton_Click(object sender, EventArgs e) private void promotionsButton_Click(object sender, EventArgs e)
{ {
var data = LoadConfigData();
promotionsAndMenuPanel.currentPageIndex=0; promotionsAndMenuPanel.currentPageIndex=0;
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground; newSongAlertButton.BackgroundImage = newSongAlertNormalBackground;
hotPlayButton.BackgroundImage = hotPlayNormalBackground; hotPlayButton.BackgroundImage = hotPlayNormalBackground;
@ -88,7 +92,7 @@ namespace DualScreenDemo
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_優惠活動(已按).png")); promotionsButton.BackgroundImage = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\1.主類別\\主類別上方_優惠活動(已按).png"));
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground; deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;

View File

@ -8,10 +8,13 @@ namespace DualScreenDemo
public void OverlayQRCodeOnImage(string randomFolderPath) public void OverlayQRCodeOnImage(string randomFolderPath)
{ {
var data = LoadConfigData();
try try
{ {
string imagePath = Path.Combine(Application.StartupPath, "themes/superstar/button/3.介面/手機點歌QR碼_完整介面.png"); string imagePath = Path.Combine(data["ImageSrc"]["path"], "themes/superstar/button/3.介面/手機點歌QR碼_完整介面.png");
if (!File.Exists(imagePath)) if (!File.Exists(imagePath))
{ {
Console.WriteLine("Base image not found: " + imagePath); Console.WriteLine("Base image not found: " + imagePath);
@ -79,7 +82,7 @@ namespace DualScreenDemo
ResizeAndPositionControl(pictureBoxQRCode, 975, 442, 226, 274); ResizeAndPositionControl(pictureBoxQRCode, 975, 442, 226, 274);
Bitmap originalImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\手機點歌QR碼_完整介面.png")); Bitmap originalImage = new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\手機點歌QR碼_完整介面.png"));
//Rectangle closeQRCodeCropArea = new Rectangle(198, 6, 22, 22); //Rectangle closeQRCodeCropArea = new Rectangle(198, 6, 22, 22);

View File

@ -24,15 +24,16 @@ namespace DualScreenDemo
private void InitializeSoundEffectButtons() private void InitializeSoundEffectButtons()
{ {
var data = LoadConfigData();
constructionButton = new Button constructionButton = new Button
{ {
Name = "constructionButton", Name = "constructionButton",
}; };
ConfigureButton(constructionButton, 876, 494, 148, 64, ConfigureButton(constructionButton, 876, 494, 148, 64,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_工地.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_工地.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_工地.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_工地.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_工地.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_工地.png")),
ConstructionButton_Click); ConstructionButton_Click);
this.Controls.Add(constructionButton); this.Controls.Add(constructionButton);
@ -42,9 +43,9 @@ namespace DualScreenDemo
Name = "marketButton", Name = "marketButton",
}; };
ConfigureButton(marketButton, 1037, 495, 148, 63, ConfigureButton(marketButton, 1037, 495, 148, 63,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_市場.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_市場.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_市場.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_市場.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_市場.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_市場.png")),
MarketButton_Click); MarketButton_Click);
this.Controls.Add(marketButton); this.Controls.Add(marketButton);
@ -54,9 +55,9 @@ namespace DualScreenDemo
Name = "drivingButton", Name = "drivingButton",
}; };
ConfigureButton(drivingButton, 876, 570, 148, 63, ConfigureButton(drivingButton, 876, 570, 148, 63,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_開車.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_開車.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_開車.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_開車.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_開車.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_開車.png")),
DrivingButton_Click); DrivingButton_Click);
this.Controls.Add(drivingButton); this.Controls.Add(drivingButton);
@ -66,9 +67,9 @@ namespace DualScreenDemo
Name = "airportButton", Name = "airportButton",
}; };
ConfigureButton(airportButton, 1037, 570, 148, 63, ConfigureButton(airportButton, 1037, 570, 148, 63,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_機場.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_機場.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_機場.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_機場.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_機場.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_機場.png")),
AirportButton_Click); AirportButton_Click);
this.Controls.Add(airportButton); this.Controls.Add(airportButton);
@ -78,9 +79,9 @@ namespace DualScreenDemo
Name = "officeButton", Name = "officeButton",
}; };
ConfigureButton(officeButton, 876, 646, 148, 64, ConfigureButton(officeButton, 876, 646, 148, 64,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")),
OfficeButton_Click); OfficeButton_Click);
this.Controls.Add(officeButton); this.Controls.Add(officeButton);
@ -91,15 +92,16 @@ namespace DualScreenDemo
}; };
ConfigureButton(closeButton, 1036, 646, 150, 63, ConfigureButton(closeButton, 1036, 646, 150, 63,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")),
CloseButton_Click); CloseButton_Click);
this.Controls.Add(closeButton); this.Controls.Add(closeButton);
} }
private void SoundEffectButton_Click(object sender, EventArgs e) private void SoundEffectButton_Click(object sender, EventArgs e)
{ {
var data = LoadConfigData();
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);
SetNewSongButtonsVisibility(false); SetNewSongButtonsVisibility(false);
@ -108,7 +110,7 @@ namespace DualScreenDemo
if (!pictureBoxSceneSoundEffects.Visible) if (!pictureBoxSceneSoundEffects.Visible)
{ {
ShowImageOnPictureBoxSceneSoundEffects(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\場景音效_空白介面.png")); ShowImageOnPictureBoxSceneSoundEffects(Path.Combine(data["ImageSrc"]["path"], @"themes\superstar\button\3.介面\場景音效_空白介面.png"));
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(true); SetPictureBoxSceneSoundEffectsAndButtonsVisibility(true);
} }
else else

View File

@ -40,72 +40,74 @@ namespace DualScreenDemo
this.primaryScreenPanel.BorderStyle = BorderStyle.FixedSingle; this.primaryScreenPanel.BorderStyle = BorderStyle.FixedSingle;
this.primaryScreenPanel.BackColor = System.Drawing.Color.Black; this.primaryScreenPanel.BackColor = System.Drawing.Color.Black;
var data=LoadConfigData();
// 同步畫面 服務鈴 // 同步畫面 服務鈴
ConfigureButton(this.syncServiceBellButton, 1240, 17, 161, 161, ConfigureButton(this.syncServiceBellButton, 1240, 17, 161, 161,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")),
//(sender, e) => SendCommandThroughSerialPort("a2 53 a4")); //(sender, e) => SendCommandThroughSerialPort("a2 53 a4"));
(sender,e)=>OnServiceBellButtonClick(sender,e)); (sender,e)=>OnServiceBellButtonClick(sender,e));
ConfigureButton(this.syncCutSongButton, 1218, 195, 205, 56, ConfigureButton(this.syncCutSongButton, 1218, 195, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")), (sender, e) => videoPlayerForm.PlayNextSong()); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")), (sender, e) => videoPlayerForm.PlayNextSong());
ConfigureButton(this.syncReplayButton, 1218, 265, 205, 56, ConfigureButton(this.syncReplayButton, 1218, 265, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")), ReplayButton_Click); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")), ReplayButton_Click);
// 有人聲入口位置 // 有人聲入口位置
ConfigureButton(this.syncOriginalSongButton, 1218, 335, 205, 56, ConfigureButton(this.syncOriginalSongButton, 1218, 335, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")), (sender,e) => videoPlayerForm.ToggleVocalRemoval()); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")), (sender,e) => videoPlayerForm.ToggleVocalRemoval());
ConfigureButton(this.syncMuteButton, 1218, 406, 205, 55, ConfigureButton(this.syncMuteButton, 1218, 406, 205, 55,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")), MuteUnmuteButton_Click); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")), MuteUnmuteButton_Click);
ConfigureButton(this.syncPauseButton, 1218, 475, 205, 56, ConfigureButton(this.syncPauseButton, 1218, 475, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), SyncPauseButton_Click); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), SyncPauseButton_Click);
ConfigureButton(this.syncPlayButton, 1218, 475, 205, 56, ConfigureButton(this.syncPlayButton, 1218, 475, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), SyncPlayButton_Click); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), SyncPlayButton_Click);
ConfigureButton(this.syncVolumeUpButton, 1218, 546, 205, 55, ConfigureButton(this.syncVolumeUpButton, 1218, 546, 205, 55,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")), null); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")), null);
this.syncVolumeUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑ ","a2 b3 a4"); }; this.syncVolumeUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑ ","a2 b3 a4"); };
this.syncVolumeUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); }; this.syncVolumeUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
ConfigureButton(this.syncVolumeDownButton, 1218, 616, 205, 55, ConfigureButton(this.syncVolumeDownButton, 1218, 616, 205, 55,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")), null); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")), null);
this.syncVolumeDownButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓ ","a2 b4 a4");}; this.syncVolumeDownButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓ ","a2 b4 a4");};
this.syncVolumeDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel();}; this.syncVolumeDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel();};
ConfigureButton(this.syncMicUpButton, 1218, 686, 205, 56, ConfigureButton(this.syncMicUpButton, 1218, 686, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")), null); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")), null);
this.syncMicUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑ ","a2 b5 a4");}; this.syncMicUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑ ","a2 b5 a4");};
this.syncMicUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); }; this.syncMicUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
ConfigureButton(this.syncMicDownButton, 1218, 756, 205, 56, ConfigureButton(this.syncMicDownButton, 1218, 756, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")), null); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")), null);
this.syncMicDownButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓ ","a2 b6 a4");}; this.syncMicDownButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓ ","a2 b6 a4");};
this.syncMicDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); }; this.syncMicDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
@ -114,9 +116,9 @@ namespace DualScreenDemo
ConfigureButton(this.syncCloseButton, 1218, 826, 205, 56, ConfigureButton(this.syncCloseButton, 1218, 826, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")), SyncCloseButton_Click); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")), SyncCloseButton_Click);

View File

@ -30,12 +30,13 @@ namespace DualScreenDemo
private void InitializeButtonsForPictureBoxToggleLight() private void InitializeButtonsForPictureBoxToggleLight()
{ {
var data=LoadConfigData();
btnTurnOn = new Button { Text = "" }; btnTurnOn = new Button { Text = "" };
ConfigureButton(btnTurnOn, 29, 45, 250, 67, ConfigureButton(btnTurnOn, 29, 45, 250, 67,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
null); null);
@ -71,9 +72,9 @@ namespace DualScreenDemo
btnBright = new Button{ Text = "" }; btnBright = new Button{ Text = "" };
ConfigureButton(btnBright, 295, 45, 118, 65, ConfigureButton(btnBright, 295, 45, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")),
null); null);
btnBright.Click += (sender, e) => btnBright.Click += (sender, e) =>
{ {
@ -95,74 +96,74 @@ namespace DualScreenDemo
btnRomantic = new Button{ Text = "" }; btnRomantic = new Button{ Text = "" };
ConfigureButton(btnRomantic, 430, 45, 118, 65, ConfigureButton(btnRomantic, 430, 45, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_浪漫.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_浪漫.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_浪漫.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_浪漫.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_浪漫.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_浪漫.png")),
(sender, e) => SendCommandThroughSerialPort("a2 d7 a4")); (sender, e) => SendCommandThroughSerialPort("a2 d7 a4"));
btnAuto = new Button{ Text = "" }; btnAuto = new Button{ Text = "" };
ConfigureButton(btnAuto, 430, 125, 118, 65, ConfigureButton(btnAuto, 430, 125, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")),
null); null);
btnColorTuning = new Button{ Text = "" }; btnColorTuning = new Button{ Text = "" };
ConfigureButton(btnColorTuning, 430, 203, 118, 65, ConfigureButton(btnColorTuning, 430, 203, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_調色.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_調色.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_調色.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_調色.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_調色.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_調色.png")),
(sender, e) => SendCommandThroughSerialPort("a2 75 a4")); (sender, e) => SendCommandThroughSerialPort("a2 75 a4"));
btnSoft = new Button{ Text = "" }; btnSoft = new Button{ Text = "" };
ConfigureButton(btnSoft, 295, 125, 118, 65, ConfigureButton(btnSoft, 295, 125, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_柔和.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_柔和.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_柔和.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_柔和.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_柔和.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_柔和.png")),
(sender, e) => SendCommandThroughSerialPort("a2 d6 a4")); (sender, e) => SendCommandThroughSerialPort("a2 d6 a4"));
btnDynamic = new Button{ Text = "" }; btnDynamic = new Button{ Text = "" };
ConfigureButton(btnDynamic, 295, 203, 118, 65, ConfigureButton(btnDynamic, 295, 203, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_動感.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_動感.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_動感.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_動感.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_動感.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_動感.png")),
(sender, e) => SendCommandThroughSerialPort("a2 d8 a4")); (sender, e) => SendCommandThroughSerialPort("a2 d8 a4"));
btnDeskLamp = new Button{ Text = "" }; btnDeskLamp = new Button{ Text = "" };
ConfigureButton(btnDeskLamp, 430, 283, 118, 65, ConfigureButton(btnDeskLamp, 430, 283, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_桌燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_桌燈.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_桌燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_桌燈.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_桌燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_桌燈.png")),
(sender, e) => SendCommandThroughSerialPort("a2 fb a4")); (sender, e) => SendCommandThroughSerialPort("a2 fb a4"));
btnStageLight = new Button{ Text = "" }; btnStageLight = new Button{ Text = "" };
ConfigureButton(btnStageLight, 295, 283, 118, 65, ConfigureButton(btnStageLight, 295, 283, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_舞台燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_舞台燈.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_舞台燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_舞台燈.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_舞台燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_舞台燈.png")),
(sender, e) => SendCommandThroughSerialPort("a2 fa a4")); (sender, e) => SendCommandThroughSerialPort("a2 fa a4"));
btnShelfLight = new Button{ Text = "" }; btnShelfLight = new Button{ Text = "" };
ConfigureButton(btnShelfLight, 163, 283, 118, 65, ConfigureButton(btnShelfLight, 163, 283, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_層板燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_層板燈.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_層板燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_層板燈.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_層板燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_層板燈.png")),
(sender, e) => SendCommandThroughSerialPort("a2 f9 a4")); (sender, e) => SendCommandThroughSerialPort("a2 f9 a4"));
btnWallLight = new Button{ Text = "" }; btnWallLight = new Button{ Text = "" };
ConfigureButton(btnWallLight, 29, 283, 118, 65, ConfigureButton(btnWallLight, 29, 283, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")), new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")),
(sender, e) => SendCommandThroughSerialPort("a2 f8 a4")); (sender, e) => SendCommandThroughSerialPort("a2 f8 a4"));

View File

@ -22,59 +22,49 @@ namespace DualScreenDemo
int xPosition = (screenWidth - pictureBoxWidth) / 2; int xPosition = (screenWidth - pictureBoxWidth) / 2;
int yPosition = (screenHeight - pictureBoxHeight) / 2; int yPosition = (screenHeight - pictureBoxHeight) / 2;
var data=LoadConfigData();
vodButton = new Button(); vodButton = new Button();
vodButton.Text = ""; vodButton.Text = "";
ResizeAndPositionButton(vodButton, xPosition - 119, yPosition + 35, 110, 50); ConfigureButton(vodButton, xPosition - 119, yPosition + 35, 110, 50,
vodButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\歌曲點播_點播.png")); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
vodButton.BackgroundImageLayout = ImageLayout.Stretch; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
vodButton.FlatStyle = FlatStyle.Flat; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
vodButton.FlatAppearance.BorderSize = 0; VodButton_Click);
vodButton.BackColor = Color.Transparent;
vodButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
vodButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
vodButton.Click += VodButton_Click;
vodButton.Visible = false; vodButton.Visible = false;
insertButton = new Button(); insertButton = new Button();
insertButton.Text = ""; insertButton.Text = "";
ResizeAndPositionButton(insertButton, xPosition + 12 , yPosition + 35, 110, 50); ConfigureButton(insertButton, xPosition + 12, yPosition + 35, 110, 50,
insertButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\歌曲點播_插播.png")); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_插播.png")),
insertButton.BackgroundImageLayout = ImageLayout.Stretch; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_插播.png")),
insertButton.FlatStyle = FlatStyle.Flat; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_插播.png")),
insertButton.FlatAppearance.BorderSize = 0; InsertButton_Click);
insertButton.BackColor = Color.Transparent;
insertButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
insertButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
insertButton.Click += InsertButton_Click;
insertButton.Visible = false; insertButton.Visible = false;
albumButton = new Button(); albumButton = new Button();
albumButton.Text = ""; albumButton.Text = "";
ResizeAndPositionButton(albumButton, xPosition + 142, yPosition + 35, 140, 50); ConfigureButton(albumButton, xPosition + 142, yPosition + 35, 140, 50,
albumButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\歌曲點播_歷年專輯.png")); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_歷年專輯.png")),
albumButton.BackgroundImageLayout = ImageLayout.Stretch; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_歷年專輯.png")),
albumButton.FlatStyle = FlatStyle.Flat; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_歷年專輯.png")),
albumButton.FlatAppearance.BorderSize = 0; AlbumButton_Click);
albumButton.BackColor = Color.Transparent;
albumButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
albumButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
albumButton.Click += AlbumButton_Click;
albumButton.Visible = false; albumButton.Visible = false;
favoriteButton = new Button(); favoriteButton = new Button();
favoriteButton.Text = ""; favoriteButton.Text = "";
ResizeAndPositionButton(favoriteButton, xPosition + 302, yPosition + 35, 140, 50); ConfigureButton(favoriteButton, xPosition + 302, yPosition + 35, 140, 50,
favoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\歌曲點播_我的最愛.png")); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_我的最愛.png")),
favoriteButton.BackgroundImageLayout = ImageLayout.Stretch; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_我的最愛.png")),
favoriteButton.FlatStyle = FlatStyle.Flat; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_我的最愛.png")),
favoriteButton.FlatAppearance.BorderSize = 0; FavoriteButton_Click);
favoriteButton.BackColor = Color.Transparent;
favoriteButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
favoriteButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
disabledPanel = new Panel(); disabledPanel = new Panel();
disabledPanel.BackColor = Color.FromArgb(128, Color.Black); disabledPanel.BackColor = Color.FromArgb(128, Color.Black);
@ -84,7 +74,6 @@ namespace DualScreenDemo
favoriteButton.Controls.Add(disabledPanel); favoriteButton.Controls.Add(disabledPanel);
favoriteButton.Click += FavoriteButton_Click;
if (!isLoggedIn) { if (!isLoggedIn) {
@ -96,16 +85,11 @@ namespace DualScreenDemo
vodScreenCloseButton = new Button(); vodScreenCloseButton = new Button();
vodScreenCloseButton.Text = ""; vodScreenCloseButton.Text = "";
ResizeAndPositionButton(vodScreenCloseButton, xPosition + 462, yPosition + 35, 110, 50); ConfigureButton(vodScreenCloseButton, xPosition + 462, yPosition + 35, 110, 50,
vodScreenCloseButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\歌曲點播_關閉.png")); new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_關閉.png")),
vodScreenCloseButton.BackgroundImageLayout = ImageLayout.Stretch; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_關閉.png")),
vodScreenCloseButton.FlatStyle = FlatStyle.Flat; new Bitmap(Path.Combine(data["ImageSrc"]["path"], "themes\\superstar\\button\\3.介面\\歌曲點播_關閉.png")),
vodScreenCloseButton.FlatAppearance.BorderSize = 0; VodScreenCloseButton_Click);
vodScreenCloseButton.BackColor = Color.Transparent;
vodScreenCloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
vodScreenCloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
vodScreenCloseButton.Click += VodScreenCloseButton_Click;
vodScreenCloseButton.Visible = false;
this.Controls.Add(vodButton); this.Controls.Add(vodButton);

View File

@ -4,7 +4,7 @@ using IniParser;
using IniParser.Model; using IniParser.Model;
using System.Text; using System.Text;
using DBObj; using DBObj;
using System;
/* /*
WordCountSongs -> SongIDSearch WordCountSongs -> SongIDSearch
@ -71,13 +71,13 @@ namespace DualScreenDemo
numberSearchSongButton.BackgroundImage = numberSearchSongActiveBackground; numberSearchSongButton.BackgroundImage = numberSearchSongActiveBackground;
// 載入設定檔,取得圖片路徑資訊 // 載入設定檔,取得圖片路徑資訊
var configData = LoadConfigDataforSongIDSearch(); var configData = LoadConfigData();
// 取得「注音歌手圖片」的完整路徑 // 取得「注音歌手圖片」的完整路徑
string imagePath = Path.Combine(Application.StartupPath, configData["ImagePaths"]["SongIDSearch"]); string imagePath = Path.Combine(configData["ImageSrc"]["path"], configData["ImagePaths"]["SongIDSearch"]);
// 在 PictureBox 中顯示對應的「注音歌手」圖片 // 在 PictureBox 中顯示對應的「注音歌手」圖片
ShowImageOnPictureBoxSongIDSearch(Path.Combine(Application.StartupPath, imagePath)); ShowImageOnPictureBoxSongIDSearch(Path.Combine(configData["ImageSrc"]["path"], imagePath));
// 鍵盤UI介面顯示設定 // 鍵盤UI介面顯示設定
SetWordCountSongsAndButtonsVisibility(false); SetWordCountSongsAndButtonsVisibility(false);
@ -106,41 +106,17 @@ namespace DualScreenDemo
// 設定檔路徑 // 設定檔路徑
string iniFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.ini"); string iniFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.ini");
// 載入設定檔,取得圖片路徑資訊
IniData data; var configData = LoadConfigData();
// 以 UTF-8 編碼開啟並讀取 INI 檔案
using (var reader = new StreamReader(iniFilePath, Encoding.UTF8))
{
// 解析 INI 檔內容
data = parser.ReadData(reader);
}
// 取得 [NumberSongIDSymbols] 區塊中的 "Symbols" 欄位內容 // 取得 [NumberSongIDSymbols] 區塊中的 "Symbols" 欄位內容
string symbols = data["NumberSongIDSymbols"]["Symbols"]; string symbols = configData["NumberSongIDSymbols"]["Symbols"];
// 將符號字串以逗號分隔,轉換為字串陣列 // 將符號字串以逗號分隔,轉換為字串陣列
numberSongIDSymbols = symbols.Split(','); numberSongIDSymbols = symbols.Split(',');
} }
/// <summary>
/// 從設定檔 (config.ini) 載入 INI 設定數據。
/// </summary>
/// <returns>回傳解析後的 INI 設定數據 (IniData)。</returns>
private IniData LoadConfigDataforSongIDSearch()
{
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);
}
}
/// <summary> /// <summary>
/// 從 INI 設定數據中讀取注音符號 (NumberSongID Symbols)。 /// 從 INI 設定數據中讀取注音符號 (NumberSongID Symbols)。
/// </summary> /// </summary>
@ -253,7 +229,7 @@ namespace DualScreenDemo
private void InitializeNumberSongIDButtons() private void InitializeNumberSongIDButtons()
{ {
// 載入配置資料 // 載入配置資料
var data = LoadConfigDataforSongIDSearch(); var data = LoadConfigData();
// 載入語音符號(如拼音、注音符號等) // 載入語音符號(如拼音、注音符號等)
numberSongIDSymbols = LoadNumberSongIDSymbols(data); numberSongIDSymbols = LoadNumberSongIDSymbols(data);
@ -429,7 +405,7 @@ namespace DualScreenDemo
private void InitializeModifyButtonSongIDSearch() private void InitializeModifyButtonSongIDSearch()
{ {
// 加載配置數據 // 加載配置數據
var data = LoadConfigDataforSongIDSearch(); var data = LoadConfigData();
// 讀取按鈕坐標 // 讀取按鈕坐標
modifyButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "modifyButtonSongIDSearch"); modifyButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "modifyButtonSongIDSearch");
@ -469,7 +445,7 @@ namespace DualScreenDemo
private void InitializeClearButtonSongIDSearch() private void InitializeClearButtonSongIDSearch()
{ {
// 加載配置數據 // 加載配置數據
var data = LoadConfigDataforSongIDSearch(); var data = LoadConfigData();
// 讀取按鈕坐標 // 讀取按鈕坐標
clearButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "clearButtonSongIDSearch"); clearButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "clearButtonSongIDSearch");
@ -491,7 +467,7 @@ namespace DualScreenDemo
private void InitializeEnterButtonSongIDSearch() private void InitializeEnterButtonSongIDSearch()
{ {
// 加載配置數據 // 加載配置數據
var data = LoadConfigDataforSongIDSearch(); var data = LoadConfigData();
// 讀取按鈕坐標 // 讀取按鈕坐標
enterButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "enterButtonSongIDSearch"); enterButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "enterButtonSongIDSearch");
@ -531,7 +507,7 @@ namespace DualScreenDemo
private void InitializeCloseButtonSongIDSearch() private void InitializeCloseButtonSongIDSearch()
{ {
// 加載配置數據 // 加載配置數據
var data = LoadConfigDataforSongIDSearch(); var data = LoadConfigData();
// 讀取按鈕坐標 // 讀取按鈕坐標
closeButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "closeButtonSongIDSearch"); closeButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "closeButtonSongIDSearch");