介面圖片更新

This commit is contained in:
allen.yan 2025-08-06 10:47:43 +08:00
parent 88b72ea294
commit 331a4200f3
35 changed files with 1501 additions and 1160 deletions

View File

@ -35,7 +35,7 @@ namespace DualScreenDemo
categorySearchButton.Name = "categorySearchButton"; categorySearchButton.Name = "categorySearchButton";
ResizeAndPositionButton(categorySearchButton, 731, 97, 99, 99); ResizeAndPositionButton(categorySearchButton, 731, 97, 99, 99);
Rectangle categorySearchCropArea = new Rectangle(731, 97, 99, 99); Rectangle categorySearchCropArea = new Rectangle(731, 97, 99, 99);
categorySearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\ICON上方\\上方ICON_類別查詢-07.png")); categorySearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_類別查詢-07.png"));
categorySearchActiveBackground = mouseDownImage.Clone(categorySearchCropArea, mouseDownImage.PixelFormat); categorySearchActiveBackground = mouseDownImage.Clone(categorySearchCropArea, mouseDownImage.PixelFormat);
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
categorySearchButton.BackgroundImageLayout = ImageLayout.Stretch; categorySearchButton.BackgroundImageLayout = ImageLayout.Stretch;
@ -49,10 +49,10 @@ namespace DualScreenDemo
{ {
loveDuetButton = new Button { Text = "", Visible = false }; loveDuetButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(loveDuetButton, 1214, 230, 209, 59); ResizeAndPositionButton(loveDuetButton, 1197, 225, 225, 50);
Rectangle loveDuetButtonCropArea = new Rectangle(1214, 230, 209, 59); Rectangle loveDuetButtonCropArea = new Rectangle(1197, 225, 225, 50);
loveDuetNormalBackground = normalStateImageCategoryQuery.Clone(loveDuetButtonCropArea, normalStateImageCategoryQuery.PixelFormat); loveDuetNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_男女情歌(未按).png"));
loveDuetActiveBackground = mouseDownImageCategoryQuery.Clone(loveDuetButtonCropArea, mouseDownImageCategoryQuery.PixelFormat); loveDuetActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_男女情歌(已按).png"));
loveDuetButton.BackgroundImage = loveDuetNormalBackground; loveDuetButton.BackgroundImage = loveDuetNormalBackground;
loveDuetButton.BackgroundImageLayout = ImageLayout.Stretch; loveDuetButton.BackgroundImageLayout = ImageLayout.Stretch;
loveDuetButton.FlatStyle = FlatStyle.Flat; loveDuetButton.FlatStyle = FlatStyle.Flat;
@ -62,10 +62,10 @@ namespace DualScreenDemo
talentShowButton = new Button { Text = "", Visible = false }; talentShowButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(talentShowButton, 1214, 293, 209, 58); ResizeAndPositionButton(talentShowButton, 1197, 280, 225, 50);
Rectangle talentShowButtonCropArea = new Rectangle(1214, 293, 209, 58); Rectangle talentShowButtonCropArea = new Rectangle(1197, 280, 225, 50);
talentShowNormalBackground = normalStateImageCategoryQuery.Clone(talentShowButtonCropArea, normalStateImageCategoryQuery.PixelFormat); talentShowNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_選秀節目(未按).png"));
talentShowActiveBackground = mouseDownImageCategoryQuery.Clone(talentShowButtonCropArea, mouseDownImageCategoryQuery.PixelFormat); talentShowActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_選秀節目(已按).png"));
talentShowButton.BackgroundImage = talentShowNormalBackground; talentShowButton.BackgroundImage = talentShowNormalBackground;
talentShowButton.BackgroundImageLayout = ImageLayout.Stretch; talentShowButton.BackgroundImageLayout = ImageLayout.Stretch;
talentShowButton.FlatStyle = FlatStyle.Flat; talentShowButton.FlatStyle = FlatStyle.Flat;
@ -75,10 +75,10 @@ namespace DualScreenDemo
medleyDanceButton = new Button { Text = "", Visible = false }; medleyDanceButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(medleyDanceButton, 1214, 356, 209, 58); ResizeAndPositionButton(medleyDanceButton, 1197, 335, 225, 50);
Rectangle medleyDanceButtonCropArea = new Rectangle(1214, 356, 209, 58); Rectangle medleyDanceButtonCropArea = new Rectangle(1197, 335, 225, 50);
medleyDanceNormalBackground = normalStateImageCategoryQuery.Clone(medleyDanceButtonCropArea, normalStateImageCategoryQuery.PixelFormat); medleyDanceNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_串燒舞曲(未按).png"));
medleyDanceActiveBackground = mouseDownImageCategoryQuery.Clone(medleyDanceButtonCropArea, mouseDownImageCategoryQuery.PixelFormat); medleyDanceActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_串燒舞曲(已按).png"));
medleyDanceButton.BackgroundImage = medleyDanceNormalBackground; medleyDanceButton.BackgroundImage = medleyDanceNormalBackground;
medleyDanceButton.BackgroundImageLayout = ImageLayout.Stretch; medleyDanceButton.BackgroundImageLayout = ImageLayout.Stretch;
medleyDanceButton.FlatStyle = FlatStyle.Flat; medleyDanceButton.FlatStyle = FlatStyle.Flat;
@ -88,10 +88,10 @@ namespace DualScreenDemo
ninetiesButton = new Button { Text = "", Visible = false }; ninetiesButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(ninetiesButton, 1214, 418, 209, 59); ResizeAndPositionButton(ninetiesButton, 1197, 390, 225, 50);
Rectangle ninetiesButtonCropArea = new Rectangle(1214, 418, 209, 59); Rectangle ninetiesButtonCropArea = new Rectangle(1197, 390, 225, 50);
ninetiesNormalBackground = normalStateImageCategoryQuery.Clone(ninetiesButtonCropArea, normalStateImageCategoryQuery.PixelFormat); ninetiesNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_90年代(未按).png"));
ninetiesActiveBackground = mouseDownImageCategoryQuery.Clone(ninetiesButtonCropArea, mouseDownImageCategoryQuery.PixelFormat); ninetiesActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_90年代(已按).png"));
ninetiesButton.BackgroundImage = ninetiesNormalBackground; ninetiesButton.BackgroundImage = ninetiesNormalBackground;
ninetiesButton.BackgroundImageLayout = ImageLayout.Stretch; ninetiesButton.BackgroundImageLayout = ImageLayout.Stretch;
ninetiesButton.FlatStyle = FlatStyle.Flat; ninetiesButton.FlatStyle = FlatStyle.Flat;
@ -101,10 +101,10 @@ namespace DualScreenDemo
nostalgicSongsButton = new Button { Text = "", Visible = false }; nostalgicSongsButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(nostalgicSongsButton, 1214, 481, 209, 59); ResizeAndPositionButton(nostalgicSongsButton, 1197, 445, 225, 50);
Rectangle nostalgicSongsButtonCropArea = new Rectangle(1214, 481, 209, 59); Rectangle nostalgicSongsButtonCropArea = new Rectangle(1197, 445, 225, 50);
nostalgicSongsNormalBackground = normalStateImageCategoryQuery.Clone(nostalgicSongsButtonCropArea, normalStateImageCategoryQuery.PixelFormat); nostalgicSongsNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_懷舊老歌(未按).png"));
nostalgicSongsActiveBackground = mouseDownImageCategoryQuery.Clone(nostalgicSongsButtonCropArea, mouseDownImageCategoryQuery.PixelFormat); nostalgicSongsActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_懷舊老歌(已按).png"));
nostalgicSongsButton.BackgroundImage = nostalgicSongsNormalBackground; nostalgicSongsButton.BackgroundImage = nostalgicSongsNormalBackground;
nostalgicSongsButton.BackgroundImageLayout = ImageLayout.Stretch; nostalgicSongsButton.BackgroundImageLayout = ImageLayout.Stretch;
nostalgicSongsButton.FlatStyle = FlatStyle.Flat; nostalgicSongsButton.FlatStyle = FlatStyle.Flat;
@ -114,11 +114,11 @@ namespace DualScreenDemo
chinaSongsButton = new Button { Text = "", Visible = false }; chinaSongsButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(chinaSongsButton, 1214, 544, 209, 58); ResizeAndPositionButton(chinaSongsButton, 1197, 500, 225, 50);
Rectangle chinaCropArea = new Rectangle(1214, 544, 209, 58); Rectangle chinaCropArea = new Rectangle(1197, 500, 225, 50);
chinaNormalBackground = normalStateImageCategoryQuery.Clone(chinaCropArea, normalStateImageCategoryQuery.PixelFormat); chinaNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_中國大陸(未按).png"));
chinaActiveBackground = mouseDownImageCategoryQuery.Clone(chinaCropArea, mouseDownImageCategoryQuery.PixelFormat); chinaActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_中國大陸(已按).png"));
chinaSongsButton.BackgroundImage = chinaNormalBackground; chinaSongsButton.BackgroundImage = chinaNormalBackground;
chinaSongsButton.BackgroundImageLayout = ImageLayout.Stretch; chinaSongsButton.BackgroundImageLayout = ImageLayout.Stretch;
chinaSongsButton.FlatStyle = FlatStyle.Flat; chinaSongsButton.FlatStyle = FlatStyle.Flat;
@ -127,11 +127,11 @@ namespace DualScreenDemo
this.Controls.Add(chinaSongsButton); this.Controls.Add(chinaSongsButton);
vietnameseSongsButton = new Button { Text = "", Visible = false }; vietnameseSongsButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(vietnameseSongsButton, 1214, 607, 209, 58); ResizeAndPositionButton(vietnameseSongsButton, 1197, 555, 225, 50);
Rectangle vietnameseCropArea = new Rectangle(1214, 607, 209, 58); Rectangle vietnameseCropArea = new Rectangle(1197, 555, 225, 50);
vietnameseNormalBackground = normalStateImageCategoryQuery.Clone(vietnameseCropArea, normalStateImageCategoryQuery.PixelFormat); vietnameseNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_越南歌曲(未按).png"));
vietnameseActiveBackground = mouseDownImageCategoryQuery.Clone(vietnameseCropArea, mouseDownImageCategoryQuery.PixelFormat); vietnameseActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_越南歌曲(已按).png"));
vietnameseSongsButton.BackgroundImage = vietnameseNormalBackground; vietnameseSongsButton.BackgroundImage = vietnameseNormalBackground;
vietnameseSongsButton.BackgroundImageLayout = ImageLayout.Stretch; vietnameseSongsButton.BackgroundImageLayout = ImageLayout.Stretch;
vietnameseSongsButton.FlatStyle = FlatStyle.Flat; vietnameseSongsButton.FlatStyle = FlatStyle.Flat;
@ -162,7 +162,7 @@ namespace DualScreenDemo
songSearchButton.BackgroundImage = songSearchNormalBackground; songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchNormalBackground; languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground; groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchActiveBackground; categorySearchButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_類別查詢(已按).png"));
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground; promotionsButton.BackgroundImage = promotionsNormalBackground;

View File

@ -1,3 +1,5 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
@ -29,10 +31,10 @@ namespace DualScreenDemo
{ {
groupGuoYuButton = new Button { Text = "", Visible = false }; groupGuoYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupGuoYuButton, 1214, 230, 209, 59); ResizeAndPositionButton(groupGuoYuButton, 1197, 225, 225, 50);
Rectangle groupGuoYuButtonCropArea = new Rectangle(1214, 230, 209, 59); Rectangle groupGuoYuButtonCropArea = new Rectangle(1197, 225, 225, 50);
groupGuoYuNormalBackground = normalStateImageLanguageQuery.Clone(groupGuoYuButtonCropArea, normalStateImageLanguageQuery.PixelFormat); groupGuoYuNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_國語(未按).png"));
groupGuoYuActiveBackground = mouseDownImageLanguageQuery.Clone(groupGuoYuButtonCropArea, mouseDownImageLanguageQuery.PixelFormat); groupGuoYuActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_國語(已按).png"));
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground; groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground;
groupGuoYuButton.BackgroundImageLayout = ImageLayout.Stretch; groupGuoYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupGuoYuButton.FlatStyle = FlatStyle.Flat; groupGuoYuButton.FlatStyle = FlatStyle.Flat;
@ -42,10 +44,10 @@ namespace DualScreenDemo
groupTaiYuButton = new Button { Text = "", Visible = false }; groupTaiYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupTaiYuButton, 1214, 293, 209, 58); ResizeAndPositionButton(groupTaiYuButton, 1197, 280, 225, 50);
Rectangle groupTaiYuButtonCropArea = new Rectangle(1214, 293, 209, 58); Rectangle groupTaiYuButtonCropArea = new Rectangle(1197, 280, 225, 50);
groupTaiYuNormalBackground = normalStateImageLanguageQuery.Clone(groupTaiYuButtonCropArea, normalStateImageLanguageQuery.PixelFormat); groupTaiYuNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_台語(未按).png"));
groupTaiYuActiveBackground = mouseDownImageLanguageQuery.Clone(groupTaiYuButtonCropArea, mouseDownImageLanguageQuery.PixelFormat); groupTaiYuActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_台語(已按).png"));
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground; groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupTaiYuButton.BackgroundImageLayout = ImageLayout.Stretch; groupTaiYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupTaiYuButton.FlatStyle = FlatStyle.Flat; groupTaiYuButton.FlatStyle = FlatStyle.Flat;
@ -55,10 +57,10 @@ namespace DualScreenDemo
groupYueYuButton = new Button { Text = "", Visible = false }; groupYueYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupYueYuButton, 1214, 356, 209, 58); ResizeAndPositionButton(groupYueYuButton, 1197, 335, 225, 50);
Rectangle groupYueYuButtonCropArea = new Rectangle(1214, 356, 209, 58); Rectangle groupYueYuButtonCropArea = new Rectangle(1197, 335, 225, 50);
groupYueYuNormalBackground = normalStateImageLanguageQuery.Clone(groupYueYuButtonCropArea, normalStateImageLanguageQuery.PixelFormat); groupYueYuNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_粵語(未按).png"));
groupYueYuActiveBackground = mouseDownImageLanguageQuery.Clone(groupYueYuButtonCropArea, mouseDownImageLanguageQuery.PixelFormat); groupYueYuActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_粵語(已按).png"));
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground; groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYueYuButton.BackgroundImageLayout = ImageLayout.Stretch; groupYueYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupYueYuButton.FlatStyle = FlatStyle.Flat; groupYueYuButton.FlatStyle = FlatStyle.Flat;
@ -68,10 +70,10 @@ namespace DualScreenDemo
groupYingWenButton = new Button { Text = "", Visible = false }; groupYingWenButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupYingWenButton, 1214, 418, 209, 59); ResizeAndPositionButton(groupYingWenButton, 1197, 390, 225, 50);
Rectangle groupYingWenButtonCropArea = new Rectangle(1214, 418, 209, 59); Rectangle groupYingWenButtonCropArea = new Rectangle(1197, 390, 225, 50);
groupYingWenNormalBackground = normalStateImageLanguageQuery.Clone(groupYingWenButtonCropArea, normalStateImageLanguageQuery.PixelFormat); groupYingWenNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_英語(未按).png"));
groupYingWenActiveBackground = mouseDownImageLanguageQuery.Clone(groupYingWenButtonCropArea, mouseDownImageLanguageQuery.PixelFormat); groupYingWenActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_英語(已按).png"));
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground; groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupYingWenButton.BackgroundImageLayout = ImageLayout.Stretch; groupYingWenButton.BackgroundImageLayout = ImageLayout.Stretch;
groupYingWenButton.FlatStyle = FlatStyle.Flat; groupYingWenButton.FlatStyle = FlatStyle.Flat;
@ -81,10 +83,10 @@ namespace DualScreenDemo
groupRiYuButton = new Button { Text = "", Visible = false }; groupRiYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupRiYuButton, 1214, 481, 209, 59); ResizeAndPositionButton(groupRiYuButton, 1197, 445, 225, 50);
Rectangle groupRiYuButtonCropArea = new Rectangle(1214, 481, 209, 59); Rectangle groupRiYuButtonCropArea = new Rectangle(1197, 445, 225, 50);
groupRiYuNormalBackground = normalStateImageLanguageQuery.Clone(groupRiYuButtonCropArea, normalStateImageLanguageQuery.PixelFormat); groupRiYuNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_日語(未按).png"));
groupRiYuActiveBackground = mouseDownImageLanguageQuery.Clone(groupRiYuButtonCropArea, mouseDownImageLanguageQuery.PixelFormat); groupRiYuActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_日語(已按).png"));
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground; groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupRiYuButton.BackgroundImageLayout = ImageLayout.Stretch; groupRiYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupRiYuButton.FlatStyle = FlatStyle.Flat; groupRiYuButton.FlatStyle = FlatStyle.Flat;
@ -94,10 +96,10 @@ namespace DualScreenDemo
groupHanYuButton = new Button { Text = "", Visible = false }; groupHanYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupHanYuButton, 1214, 544, 209, 58); ResizeAndPositionButton(groupHanYuButton, 1197, 500, 225, 50);
Rectangle groupHanYuButtonCropArea = new Rectangle(1214, 544, 209, 58); Rectangle groupHanYuButtonCropArea = new Rectangle(1197, 500, 225, 50);
groupHanYuNormalBackground = normalStateImageLanguageQuery.Clone(groupHanYuButtonCropArea, normalStateImageLanguageQuery.PixelFormat); groupHanYuNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_韓語(未按).png"));
groupHanYuActiveBackground = mouseDownImageLanguageQuery.Clone(groupHanYuButtonCropArea, mouseDownImageLanguageQuery.PixelFormat); groupHanYuActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_韓語(已按).png"));
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground; groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
groupHanYuButton.BackgroundImageLayout = ImageLayout.Stretch; groupHanYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupHanYuButton.FlatStyle = FlatStyle.Flat; groupHanYuButton.FlatStyle = FlatStyle.Flat;
@ -113,7 +115,7 @@ namespace DualScreenDemo
singerSearchButton.BackgroundImage = singerSearchNormalBackground; singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground; songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchNormalBackground; languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchActiveBackground; groupSearchButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_合唱查詢(已按).png"));
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;

View File

@ -57,12 +57,12 @@ namespace DualScreenDemo
public void HotPlayButton_Click(object sender, EventArgs e) public void HotPlayButton_Click(object sender, EventArgs e)
{ {
UpdateButtonBackgrounds(hotPlayButton, hotPlayActiveBackground); UpdateButtonBackgrounds(hotPlayButton, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_熱門排行(已按).png")));
UpdateHotSongButtons(guoYuButtonHotSong, guoYuHotSongActiveBackground); UpdateHotSongButtons(guoYuButtonHotSong, guoYuHotSongActiveBackground);
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
/* 清空搜尋欄 */ /* 清空搜尋欄 */
ResetinputBox(); ResetinputBox();
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `song_counts` DESC LIMIT {Utils.Env.GetInt("HotSongLimit", 100)};"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `song_counts` DESC LIMIT 1000;";
var guoYuSongs = SearchSongs_Mysql(query); var guoYuSongs = SearchSongs_Mysql(query);
UpdateSongList(guoYuSongs); UpdateSongList(guoYuSongs);
@ -90,7 +90,7 @@ namespace DualScreenDemo
{ {
UpdateHotSongButtons(activeButton, activeBackground); UpdateHotSongButtons(activeButton, activeBackground);
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY `song_counts` DESC LIMIT {Utils.Env.GetInt("HotSongLimit", 100)};"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY `song_counts` DESC LIMIT 1000;";
var selectedSongs = SearchSongs_Mysql(query); var selectedSongs = SearchSongs_Mysql(query);
UpdateSongList(selectedSongs); UpdateSongList(selectedSongs);
@ -147,61 +147,61 @@ namespace DualScreenDemo
private void InitializeButtonsForHotSong() private void InitializeButtonsForHotSong()
{ {
InitializeHotSongButton(ref guoYuNewSongButtonHotSong, "國語新歌", 1214, 230, 209, 58, InitializeHotSongButton(ref guoYuNewSongButtonHotSong, "國語新歌", 1197, 225, 225, 50,
normalStateImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語新歌排行(未按).png")),
out guoYuNewSongHotSongNormalBackground, out guoYuNewSongHotSongNormalBackground,
mouseDownImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語新歌排行(已按).png")),
out guoYuNewSongHotSongActiveBackground, out guoYuNewSongHotSongActiveBackground,
GuoYuNewSongButtonHotSong_Click); GuoYuNewSongButtonHotSong_Click);
InitializeHotSongButton(ref taiYuNewSongButtonHotSong, "台語新歌", 1214, 293, 209, 58, InitializeHotSongButton(ref taiYuNewSongButtonHotSong, "台語新歌", 1197, 280, 225, 50,
normalStateImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語新歌排行(未按).png")),
out taiYuNewSongHotSongNormalBackground, out taiYuNewSongHotSongNormalBackground,
mouseDownImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語新歌排行(已按).png")),
out taiYuNewSongHotSongActiveBackground, out taiYuNewSongHotSongActiveBackground,
TaiYuNewSongButtonHotSong_Click); TaiYuNewSongButtonHotSong_Click);
InitializeHotSongButton(ref taiYuButtonHotSong, "台語", 1214, 418, 209, 58, InitializeHotSongButton(ref taiYuButtonHotSong, "台語", 1197, 335, 225, 50,
normalStateImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語人氣排行(未按).png")),
out taiYuHotSongNormalBackground, out taiYuHotSongNormalBackground,
mouseDownImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語人氣排行(已按).png")),
out taiYuHotSongActiveBackground, out taiYuHotSongActiveBackground,
TaiYuButtonHotSong_Click); TaiYuButtonHotSong_Click);
InitializeHotSongButton(ref yueYuButtonHotSong, "粵語", 1214, 356, 209, 58, //InitializeHotSongButton(ref yueYuButtonHotSong, "粵語", 1197, 390, 225, 50,
normalStateImageHotSong, // normalStateImageHotSong,
out yueYuHotSongNormalBackground, // out yueYuHotSongNormalBackground,
mouseDownImageHotSong, // mouseDownImageHotSong,
out yueYuHotSongActiveBackground, // out yueYuHotSongActiveBackground,
YueYuButtonHotSong_Click); // YueYuButtonHotSong_Click);
InitializeHotSongButton(ref guoYuButtonHotSong, "國語", 1214, 356, 209, 59, InitializeHotSongButton(ref guoYuButtonHotSong, "國語", 1197, 390, 225, 50,
normalStateImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語人氣排行(未按).png")),
out guoYuHotSongNormalBackground, out guoYuHotSongNormalBackground,
mouseDownImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語人氣排行(已按).png")),
out guoYuHotSongActiveBackground, out guoYuHotSongActiveBackground,
GuoYuButtonHotSong_Click); GuoYuButtonHotSong_Click);
InitializeHotSongButton(ref yingWenButtonHotSong, "英文", 1214, 481, 209, 59, InitializeHotSongButton(ref yingWenButtonHotSong, "英文", 1197, 445, 225, 50,
normalStateImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_英語人氣排行(未按).png")),
out yingWenHotSongNormalBackground, out yingWenHotSongNormalBackground,
mouseDownImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_英語人氣排行(已按).png")),
out yingWenHotSongActiveBackground, out yingWenHotSongActiveBackground,
YingWenButtonHotSong_Click); YingWenButtonHotSong_Click);
InitializeHotSongButton(ref riYuButtonHotSong, "日語", 1214, 544, 209, 59, InitializeHotSongButton(ref riYuButtonHotSong, "日語", 1197, 500, 225, 50,
normalStateImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_日語人氣排行(未按).png")),
out riYuHotSongNormalBackground, out riYuHotSongNormalBackground,
mouseDownImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_日語人氣排行(已按).png")),
out riYuHotSongActiveBackground, out riYuHotSongActiveBackground,
RiYuButtonHotSong_Click); RiYuButtonHotSong_Click);
InitializeHotSongButton(ref hanYuButtonHotSong, "韓語", 1214, 607, 209, 58, InitializeHotSongButton(ref hanYuButtonHotSong, "韓語", 1197, 555, 225, 50,
normalStateImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_韓語人氣排行(未按).png")),
out hanYuHotSongNormalBackground, out hanYuHotSongNormalBackground,
mouseDownImageHotSong, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_韓語人氣排行(已按).png")),
out hanYuHotSongActiveBackground, out hanYuHotSongActiveBackground,
HanYuButtonHotSong_Click); HanYuButtonHotSong_Click);
@ -221,8 +221,11 @@ namespace DualScreenDemo
// 修改裁剪區域,避開文字部分 // 修改裁剪區域,避開文字部分
Rectangle cropArea = new Rectangle(1214, y, 209, 58); // 使用固定的裁剪區域 Rectangle cropArea = new Rectangle(1214, y, 209, 58); // 使用固定的裁剪區域
normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat); //normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat);
activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat); //activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat);
normalBackgroundOut = new Bitmap(normalBackground);
activeBackgroundOut = new Bitmap(activeBackground);
button.BackgroundImage = normalBackgroundOut; button.BackgroundImage = normalBackgroundOut;
button.BackgroundImageLayout = ImageLayout.Stretch; button.BackgroundImageLayout = ImageLayout.Stretch;

View File

@ -7,7 +7,7 @@ namespace DualScreenDemo
// 重置其他按钮背景 // 重置其他按钮背景
UpdateHotSongButtons(guoYuNewSongButtonHotSong, guoYuNewSongHotSongActiveBackground); UpdateHotSongButtons(guoYuNewSongButtonHotSong, guoYuNewSongHotSongActiveBackground);
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `add_date` DESC, `song_counts` DESC LIMIT {Utils.Env.GetInt("HotSongLimit", 100)};"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `add_date` DESC, `song_counts` DESC LIMIT 1000;";
var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query); var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;

View File

@ -7,7 +7,7 @@ namespace DualScreenDemo
// 重置其他按钮背景 // 重置其他按钮背景
UpdateHotSongButtons(taiYuNewSongButtonHotSong, taiYuNewSongHotSongActiveBackground); UpdateHotSongButtons(taiYuNewSongButtonHotSong, taiYuNewSongHotSongActiveBackground);
string query = $"SELECT * FROM song_library_cache WHERE language_name = '台語' ORDER BY `add_date` DESC, `song_counts` DESC LIMIT {Utils.Env.GetInt("HotSongLimit", 100)};"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '台語' ORDER BY `add_date` DESC, `song_counts` DESC LIMIT 1000;";
var selectedSongs = SearchSongs_Mysql(query); var selectedSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeGuoYuButton() private void InitializeGuoYuButton()
{ {
Rectangle guoYuButtonCropArea = new Rectangle(1214, 230, 209, 59); Rectangle guoYuButtonCropArea = new Rectangle(1197, 225, 225, 20);
InitializeButton(ref guoYuButton, "國語", 1214, 230, 209, 59, guoYuButtonCropArea, normalStateImageLanguageQuery, out guoYuNormalBackground, mouseDownImageLanguageQuery, out guoYuActiveBackground, GuoYuButton_Click); InitializeButton(ref guoYuButton, "國語", 1197, 225, 225, 50, guoYuButtonCropArea, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_國語(未按).png")), out guoYuNormalBackground, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_國語(已按).png")), out guoYuActiveBackground, GuoYuButton_Click);
} }
private void GuoYuButton_Click(object sender, EventArgs e) private void GuoYuButton_Click(object sender, EventArgs e)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeHanYuButton() private void InitializeHanYuButton()
{ {
Rectangle hanYuButtonCropArea = new Rectangle(1214, 544, 209, 58); Rectangle hanYuButtonCropArea = new Rectangle(1197, 500, 225, 50);
InitializeButton(ref hanYuButton, "韓語", 1214, 544, 209, 58, hanYuButtonCropArea, normalStateImageLanguageQuery, out hanYuNormalBackground, mouseDownImageLanguageQuery, out hanYuActiveBackground, HanYuButton_Click); InitializeButton(ref hanYuButton, "韓語", 1197, 500, 225, 50, hanYuButtonCropArea, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_韓語(未按).png")), out hanYuNormalBackground, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_韓語(已按).png")), out hanYuActiveBackground, HanYuButton_Click);
} }
private void HanYuButton_Click(object sender, EventArgs e) private void HanYuButton_Click(object sender, EventArgs e)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeKeYuButton() private void InitializeKeYuButton()
{ {
Rectangle keYuButtonCropArea = new Rectangle(1214, 607, 209, 58); Rectangle keYuButtonCropArea = new Rectangle(1197, 555, 225, 50);
InitializeButton(ref keYuButton, "客語", 1214, 607, 209, 58, keYuButtonCropArea, normalStateImageLanguageQuery, out keYuNormalBackground, mouseDownImageLanguageQuery, out keYuActiveBackground, KeYuButton_Click); InitializeButton(ref keYuButton, "客語", 1197, 555, 225, 50, keYuButtonCropArea, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_客語(未按).png")), out keYuNormalBackground, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_客語(已按).png")), out keYuActiveBackground, KeYuButton_Click);
} }
private void KeYuButton_Click(object sender, EventArgs e) private void KeYuButton_Click(object sender, EventArgs e)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeRiYuButton() private void InitializeRiYuButton()
{ {
Rectangle riYuButtonCropArea = new Rectangle(1214, 481, 209, 59); Rectangle riYuButtonCropArea = new Rectangle(1197, 445, 225, 50);
InitializeButton(ref riYuButton, "日語", 1214, 481, 209, 59, riYuButtonCropArea, normalStateImageLanguageQuery, out riYuNormalBackground, mouseDownImageLanguageQuery, out riYuActiveBackground, RiYuButton_Click); InitializeButton(ref riYuButton, "日語", 1197, 445, 225, 50, riYuButtonCropArea, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_日語(未按).png")), out riYuNormalBackground, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_日語(已按).png")), out riYuActiveBackground, RiYuButton_Click);
} }
private void RiYuButton_Click(object sender, EventArgs e) private void RiYuButton_Click(object sender, EventArgs e)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeTaiYuButton() private void InitializeTaiYuButton()
{ {
Rectangle taiYuButtonCropArea = new Rectangle(1214, 293, 209, 58); Rectangle taiYuButtonCropArea = new Rectangle(1197, 280, 225, 50);
InitializeButton(ref taiYuButton, "台語", 1214, 293, 209, 58, taiYuButtonCropArea, normalStateImageLanguageQuery, out taiYuNormalBackground, mouseDownImageLanguageQuery, out taiYuActiveBackground, TaiYuButton_Click); InitializeButton(ref taiYuButton, "台語", 1197, 280, 225, 50, taiYuButtonCropArea, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_台語(未按).png")), out taiYuNormalBackground, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_台語(已按).png")), out taiYuActiveBackground, TaiYuButton_Click);
} }
private void TaiYuButton_Click(object sender, EventArgs e) private void TaiYuButton_Click(object sender, EventArgs e)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeYingWenButton() private void InitializeYingWenButton()
{ {
Rectangle yingWenButtonCropArea = new Rectangle(1214, 418, 209, 59); Rectangle yingWenButtonCropArea = new Rectangle(1197, 390, 225, 50);
InitializeButton(ref yingWenButton, "英文", 1214, 418, 209, 59, yingWenButtonCropArea, normalStateImageLanguageQuery, out yingWenNormalBackground, mouseDownImageLanguageQuery, out yingWenActiveBackground, YingWenButton_Click); InitializeButton(ref yingWenButton, "英文", 1197, 390, 225, 50, yingWenButtonCropArea, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_英語(未按).png")), out yingWenNormalBackground, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_英語(已按).png")), out yingWenActiveBackground, YingWenButton_Click);
} }
private void YingWenButton_Click(object sender, EventArgs e) private void YingWenButton_Click(object sender, EventArgs e)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeYueYuButton() private void InitializeYueYuButton()
{ {
Rectangle yueYuButtonCropArea = new Rectangle(1214, 356, 209, 58); Rectangle yueYuButtonCropArea = new Rectangle(1197, 335, 225, 50);
InitializeButton(ref yueYuButton, "粵語", 1214, 356, 209, 58, yueYuButtonCropArea, normalStateImageLanguageQuery, out yueYuNormalBackground, mouseDownImageLanguageQuery, out yueYuActiveBackground, YueYuButton_Click); InitializeButton(ref yueYuButton, "粵語", 1197, 335, 225, 50, yueYuButtonCropArea, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_粵語(未按).png")), out yueYuNormalBackground, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_粵語(已按).png")), out yueYuActiveBackground, YueYuButton_Click);
} }
private void YueYuButton_Click(object sender, EventArgs e) private void YueYuButton_Click(object sender, EventArgs e)

View File

@ -12,8 +12,10 @@ namespace DualScreenDemo
{ {
button = new Button { Text = "", Visible = false }; button = new Button { Text = "", Visible = false };
ResizeAndPositionButton(button, x, y, width, height); ResizeAndPositionButton(button, x, y, width, height);
normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat); //normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat);
activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat); //activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat);
normalBackgroundOut = new Bitmap(normalBackground);
activeBackgroundOut = new Bitmap(activeBackground);
button.BackgroundImage = normalBackgroundOut; button.BackgroundImage = normalBackgroundOut;
button.BackgroundImageLayout = ImageLayout.Stretch; button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat; button.FlatStyle = FlatStyle.Flat;
@ -56,7 +58,7 @@ namespace DualScreenDemo
hotPlayButton.BackgroundImage = hotPlayNormalBackground; hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground; singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground; songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchActiveBackground; languageSearchButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_語別查詢(已按).png"));
groupSearchButton.BackgroundImage = groupSearchNormalBackground; groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
@ -75,7 +77,7 @@ namespace DualScreenDemo
/* 清空搜尋欄 */ /* 清空搜尋欄 */
ResetinputBox(); ResetinputBox();
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_counts DESC LIMIT 100"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_counts DESC LIMIT 1000";
var guoYuSongs = SearchSongs_Mysql(query); var guoYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage);
@ -120,7 +122,7 @@ namespace DualScreenDemo
activeButton.BackgroundImage = activeBackground; activeButton.BackgroundImage = activeBackground;
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY song_counts DESC LIMIT 100"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY song_counts DESC LIMIT 1000";
var selectedSongs = SearchSongs_Mysql(query); var selectedSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;

View File

@ -60,7 +60,8 @@ namespace DualScreenDemo
private void NewSongAlertButton_Click(object sender, EventArgs e) private void NewSongAlertButton_Click(object sender, EventArgs e)
{ {
newSongAlertButton.BackgroundImage = newSongAlertActiveBackground; //newSongAlertButton.BackgroundImage = newSongAlertActiveBackground;
newSongAlertButton.BackgroundImage= new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_新歌快報(已按).png"));
hotPlayButton.BackgroundImage = hotPlayNormalBackground; hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground; singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground; songSearchButton.BackgroundImage = songSearchNormalBackground;
@ -82,10 +83,7 @@ namespace DualScreenDemo
/* 清空搜尋欄 */ /* 清空搜尋欄 */
ResetinputBox(); ResetinputBox();
/*guoYuSongs2 = allSongs.Where(song => song.Category == "國語")
.OrderByDescending(song => song.AddedTime)
.Take(songLimit)
.ToList();*/
string query = setQueryforNewSong("國語"); string query = setQueryforNewSong("國語");
var guoYuSongs2 = SearchSongs_Mysql(query); var guoYuSongs2 = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
@ -124,10 +122,10 @@ namespace DualScreenDemo
guoYuButtonNewSong = new Button{ Text = "", Visible = false }; guoYuButtonNewSong = new Button{ Text = "", Visible = false };
ResizeAndPositionButton(guoYuButtonNewSong, 1214, 230, 209, 59); ResizeAndPositionButton(guoYuButtonNewSong, 1197, 225, 225, 50);
Rectangle guoYuNewSongButtonCropArea = new Rectangle(1214, 230, 209, 59); Rectangle guoYuNewSongButtonCropArea = new Rectangle(1197, 225, 225, 50);
guoYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(guoYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat); guoYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_國語(未按).png"));
guoYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(guoYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat); guoYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_國語(已按).png"));
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground; guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
guoYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch; guoYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
guoYuButtonNewSong.FlatStyle = FlatStyle.Flat; guoYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -140,10 +138,10 @@ namespace DualScreenDemo
taiYuButtonNewSong = new Button { Text = "", Visible = false }; taiYuButtonNewSong = new Button { Text = "", Visible = false };
ResizeAndPositionButton(taiYuButtonNewSong, 1214, 293, 209, 58); ResizeAndPositionButton(taiYuButtonNewSong, 1197, 280, 225, 50);
Rectangle taiYuNewSongButtonCropArea = new Rectangle(1214, 293, 209, 58); Rectangle taiYuNewSongButtonCropArea = new Rectangle(1197, 280, 225, 50);
taiYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(taiYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat); taiYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_台語(未按).png"));
taiYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(taiYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat); taiYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_台語(已按).png"));
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground; taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
taiYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch; taiYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
taiYuButtonNewSong.FlatStyle = FlatStyle.Flat; taiYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -156,10 +154,10 @@ namespace DualScreenDemo
yueYuButtonNewSong = new Button { Text = "", Visible = false }; yueYuButtonNewSong = new Button { Text = "", Visible = false };
ResizeAndPositionButton(yueYuButtonNewSong, 1214, 356, 209, 58); ResizeAndPositionButton(yueYuButtonNewSong, 1197, 335, 225, 50);
Rectangle yueYuNewSongButtonCropArea = new Rectangle(1214, 356, 209, 58); Rectangle yueYuNewSongButtonCropArea = new Rectangle(1197, 335, 225, 50);
yueYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(yueYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat); yueYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_粵語(未按).png"));
yueYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(yueYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat); yueYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_粵語(已按).png"));
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground; yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch; yueYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
yueYuButtonNewSong.FlatStyle = FlatStyle.Flat; yueYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -172,10 +170,10 @@ namespace DualScreenDemo
yingWenButtonNewSong = new Button {Visible = false }; yingWenButtonNewSong = new Button {Visible = false };
ResizeAndPositionButton(yingWenButtonNewSong, 1214, 418, 209, 59); ResizeAndPositionButton(yingWenButtonNewSong, 1197, 390, 225, 50);
Rectangle yingWenNewSongButtonCropArea = new Rectangle(1214, 418, 209, 59); Rectangle yingWenNewSongButtonCropArea = new Rectangle(1197, 390, 225, 50);
yingWenNewSongNormalBackground = normalStateImageNewSongAlert.Clone(yingWenNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat); yingWenNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_英語(未按).png"));
yingWenNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(yingWenNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat); yingWenNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_英語(已按).png"));
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground; yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch; yingWenButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
yingWenButtonNewSong.FlatStyle = FlatStyle.Flat; yingWenButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -188,10 +186,10 @@ namespace DualScreenDemo
riYuButtonNewSong = new Button { Visible = false }; riYuButtonNewSong = new Button { Visible = false };
ResizeAndPositionButton(riYuButtonNewSong, 1214, 481, 209, 59); ResizeAndPositionButton(riYuButtonNewSong, 1197, 445, 225, 50);
Rectangle riYuNewSongButtonCropArea = new Rectangle(1214, 481, 209, 59); Rectangle riYuNewSongButtonCropArea = new Rectangle(1197, 445, 225, 50);
riYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(riYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat); riYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_日語(未按).png"));
riYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(riYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat); riYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_日語(已按).png"));
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground; riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
riYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch; riYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
riYuButtonNewSong.FlatStyle = FlatStyle.Flat; riYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -204,10 +202,10 @@ namespace DualScreenDemo
hanYuButtonNewSong = new Button {Visible = false }; hanYuButtonNewSong = new Button {Visible = false };
ResizeAndPositionButton(hanYuButtonNewSong, 1214, 544, 209, 58); ResizeAndPositionButton(hanYuButtonNewSong, 1197, 500, 225, 50);
Rectangle hanYuNewSongButtonCropArea = new Rectangle(1214, 544, 209, 58); Rectangle hanYuNewSongButtonCropArea = new Rectangle(1197, 500, 490, 50);
hanYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(hanYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat); hanYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_韓語(未按).png"));
hanYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(hanYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat); hanYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_韓語(已按).png"));
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground; hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch; hanYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
hanYuButtonNewSong.FlatStyle = FlatStyle.Flat; hanYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -219,7 +217,7 @@ namespace DualScreenDemo
} }
private string setQueryforNewSong(string category){ private string setQueryforNewSong(string category){
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY add_date DESC LIMIT {Utils.Env.GetInt("NewSongLimit", 100)};"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY add_date DESC LIMIT 1000;";
return query; return query;
} }

View File

@ -52,8 +52,8 @@ namespace DualScreenDemo
ResizeAndPositionButton(favoriteNumberButton[i], coords[i, 0], coords[i, 1], coords[i, 2], coords[i, 3]); ResizeAndPositionButton(favoriteNumberButton[i], coords[i, 0], coords[i, 1], coords[i, 2], coords[i, 3]);
string fileName = (i + 2).ToString("00"); string fileName = (i+1).ToString();
string filePath = Path.Combine(Application.StartupPath, @"themes\superstar\我的最愛\我的最愛-" + fileName + ".jpg"); string filePath = Path.Combine(Application.StartupPath, @"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 +85,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\我的最愛\我的最愛-12.jpg")); enterFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"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 +100,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\我的最愛\我的最愛-13.jpg")); newFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"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 +115,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\我的最愛\我的最愛-14.jpg")); refillFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"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 +130,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\我的最愛\我的最愛-15.jpg")); closeFavoriteButton.BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, @"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;
@ -337,7 +337,7 @@ namespace DualScreenDemo
groupSearchButton.BackgroundImage = groupSearchNormalBackground; groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesActiveBackground; myFavoritesButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_我的最愛(已按).png"));
promotionsButton.BackgroundImage = promotionsNormalBackground; promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground; deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;

View File

@ -53,15 +53,15 @@ namespace DualScreenDemo
// 配置各個按鈕 // 配置各個按鈕
previousPromotionButton = new Button { Name = "previousPromotionButton", Visible = true }; previousPromotionButton = new Button { Name = "previousPromotionButton", Visible = true };
ConfigurePromotionButton(previousPromotionButton, "themes\\superstar\\上一頁.png", new Point(baseX, baseY)); ConfigurePromotionButton(previousPromotionButton, "themes\\superstar\\button\\3.介面\\切換頁面_上一頁.png", new Point(baseX, baseY));
previousPromotionButton.Click += PreviousPromotionButton_Click; previousPromotionButton.Click += PreviousPromotionButton_Click;
closePromotionsButton = new Button { Name = "closePromotionsButton", Visible = false }; closePromotionsButton = new Button { Name = "closePromotionsButton", Visible = false };
ConfigurePromotionButton(closePromotionsButton, "themes\\superstar\\退出.png", new Point(baseX + buttonSpacing, baseY)); ConfigurePromotionButton(closePromotionsButton, "themes\\superstar\\button\\3.介面\\切換頁面_退出.png", new Point(baseX + buttonSpacing, baseY));
closePromotionsButton.Click += ClosePromotionsButton_Click; closePromotionsButton.Click += ClosePromotionsButton_Click;
nextPromotionButton = new Button { Name = "nextPromotionButton", Visible = true }; nextPromotionButton = new Button { Name = "nextPromotionButton", Visible = true };
ConfigurePromotionButton(nextPromotionButton, "themes\\superstar\\下一頁.png", new Point(baseX + (buttonSpacing * 2), baseY)); ConfigurePromotionButton(nextPromotionButton, "themes\\superstar\\button\\3.介面\\切換頁面_下一頁.png", new Point(baseX + (buttonSpacing * 2), baseY));
nextPromotionButton.Click += NextPromotionButton_Click; nextPromotionButton.Click += NextPromotionButton_Click;
this.Controls.Add(previousPromotionButton); this.Controls.Add(previousPromotionButton);
@ -88,7 +88,7 @@ namespace DualScreenDemo
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsActiveBackground; promotionsButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_優惠活動(已按).png"));
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground; deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;

View File

@ -11,7 +11,7 @@ namespace DualScreenDemo
try try
{ {
string imagePath = Path.Combine(Application.StartupPath, "themes/superstar/cropped_qrcode.jpg"); string imagePath = Path.Combine(Application.StartupPath, "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);
@ -66,7 +66,7 @@ namespace DualScreenDemo
// g.DrawImage(baseImage, 0, 0); // g.DrawImage(baseImage, 0, 0);
// cropped qrcode 版型不同設定調整 // cropped qrcode 版型不同設定調整
g.DrawImage(baseImage, new Rectangle(0, 0, bitmap.Width, bitmap.Height)); g.DrawImage(baseImage, new Rectangle(0, 0, bitmap.Width, bitmap.Height));
Rectangle qrCodeRect = new Rectangle(32, 39, 165, 165); Rectangle qrCodeRect = new Rectangle(41, 50, 227, 227);
g.DrawImage(qrCodeImage, qrCodeRect); g.DrawImage(qrCodeImage, qrCodeRect);
} }
@ -79,28 +79,26 @@ namespace DualScreenDemo
ResizeAndPositionControl(pictureBoxQRCode, 975, 442, 226, 274); ResizeAndPositionControl(pictureBoxQRCode, 975, 442, 226, 274);
Bitmap originalImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\cropped_qrcode.jpg")); Bitmap originalImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\手機點歌QR碼_完整介面.png"));
Rectangle closeQRCodeCropArea = new Rectangle(198, 6, 22, 22); //Rectangle closeQRCodeCropArea = new Rectangle(198, 6, 22, 22);
Bitmap closeQRCodeCroppedImage = new Bitmap(closeQRCodeCropArea.Width, closeQRCodeCropArea.Height);
using (Graphics g = Graphics.FromImage(closeQRCodeCroppedImage))
{
g.DrawImage(originalImage, new Rectangle(0, 0, closeQRCodeCropArea.Width, closeQRCodeCropArea.Height), closeQRCodeCropArea, GraphicsUnit.Pixel);
}
closeQRCodeButton = new Button { Text = "" }; closeQRCodeButton = new Button { Text = "" };
closeQRCodeButton.Name = "closeQRCodeButton"; closeQRCodeButton.Name = "closeQRCodeButton";
ResizeAndPositionButton(closeQRCodeButton, 1173, 448, 22, 22); closeQRCodeButton.Location = new Point(259, 7);
closeQRCodeButton.BackgroundImage = closeQRCodeCroppedImage; closeQRCodeButton.Size = new Size(30, 30);
closeQRCodeButton.BackColor = Color.Transparent;
closeQRCodeButton.BackgroundImageLayout = ImageLayout.Stretch; closeQRCodeButton.BackgroundImageLayout = ImageLayout.Stretch;
closeQRCodeButton.FlatStyle = FlatStyle.Flat; closeQRCodeButton.FlatStyle = FlatStyle.Flat;
closeQRCodeButton.FlatAppearance.BorderSize = 0; closeQRCodeButton.FlatAppearance.BorderSize = 0;
closeQRCodeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
closeQRCodeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
closeQRCodeButton.Click += CloseQRCodeButton_Click; closeQRCodeButton.Click += CloseQRCodeButton_Click;
this.Controls.Add(closeQRCodeButton); pictureBoxQRCode.Controls.Add(closeQRCodeButton);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -30,7 +30,9 @@ namespace DualScreenDemo
Name = "constructionButton", Name = "constructionButton",
}; };
ConfigureButton(constructionButton, 876, 494, 148, 64, ConfigureButton(constructionButton, 876, 494, 148, 64,
resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_工地.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_工地.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_工地.png")),
ConstructionButton_Click); ConstructionButton_Click);
this.Controls.Add(constructionButton); this.Controls.Add(constructionButton);
@ -40,7 +42,9 @@ namespace DualScreenDemo
Name = "marketButton", Name = "marketButton",
}; };
ConfigureButton(marketButton, 1037, 495, 148, 63, ConfigureButton(marketButton, 1037, 495, 148, 63,
resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_市場.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_市場.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_市場.png")),
MarketButton_Click); MarketButton_Click);
this.Controls.Add(marketButton); this.Controls.Add(marketButton);
@ -50,7 +54,9 @@ namespace DualScreenDemo
Name = "drivingButton", Name = "drivingButton",
}; };
ConfigureButton(drivingButton, 876, 570, 148, 63, ConfigureButton(drivingButton, 876, 570, 148, 63,
resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_開車.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_開車.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_開車.png")),
DrivingButton_Click); DrivingButton_Click);
this.Controls.Add(drivingButton); this.Controls.Add(drivingButton);
@ -60,7 +66,9 @@ namespace DualScreenDemo
Name = "airportButton", Name = "airportButton",
}; };
ConfigureButton(airportButton, 1037, 570, 148, 63, ConfigureButton(airportButton, 1037, 570, 148, 63,
resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_機場.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_機場.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_機場.png")),
AirportButton_Click); AirportButton_Click);
this.Controls.Add(airportButton); this.Controls.Add(airportButton);
@ -70,7 +78,9 @@ namespace DualScreenDemo
Name = "officeButton", Name = "officeButton",
}; };
ConfigureButton(officeButton, 876, 646, 148, 64, ConfigureButton(officeButton, 876, 646, 148, 64,
resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_辦公室.png")),
OfficeButton_Click); OfficeButton_Click);
this.Controls.Add(officeButton); this.Controls.Add(officeButton);
@ -81,7 +91,9 @@ namespace DualScreenDemo
}; };
ConfigureButton(closeButton, 1036, 646, 150, 63, ConfigureButton(closeButton, 1036, 646, 150, 63,
resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\場景音效_關閉.png")),
CloseButton_Click); CloseButton_Click);
this.Controls.Add(closeButton); this.Controls.Add(closeButton);
} }
@ -96,7 +108,7 @@ namespace DualScreenDemo
if (!pictureBoxSceneSoundEffects.Visible) if (!pictureBoxSceneSoundEffects.Visible)
{ {
ShowImageOnPictureBoxSceneSoundEffects(Path.Combine(Application.StartupPath, @"themes\superstar\555022.jpg")); ShowImageOnPictureBoxSceneSoundEffects(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\場景音效_空白介面.png"));
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(true); SetPictureBoxSceneSoundEffectsAndButtonsVisibility(true);
} }
else else
@ -147,7 +159,7 @@ namespace DualScreenDemo
Bitmap croppedImage = CropImage(originalImage, cropArea); Bitmap croppedImage = CropImage(originalImage, cropArea);
pictureBoxSceneSoundEffects.Image = croppedImage; pictureBoxSceneSoundEffects.Image = originalImage;
ResizeAndPositionPictureBox(pictureBoxSceneSoundEffects, cropArea.X, cropArea.Y, cropArea.Width, cropArea.Height); ResizeAndPositionPictureBox(pictureBoxSceneSoundEffects, cropArea.X, cropArea.Y, cropArea.Width, cropArea.Height);

View File

@ -1,4 +1,5 @@
using OverlayFormObj; using OverlayFormObj;
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm : Form public partial class PrimaryForm : Form
@ -41,34 +42,81 @@ namespace DualScreenDemo
// 同步畫面 服務鈴 // 同步畫面 服務鈴
ConfigureButton(this.syncServiceBellButton, 1240, 17, 161, 161, ConfigureButton(this.syncServiceBellButton, 1240, 17, 161, 161,
resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")),
new Bitmap(Path.Combine(Application.StartupPath, "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, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, (sender, e) => videoPlayerForm.PlayNextSong()); ConfigureButton(this.syncCutSongButton, 1218, 195, 205, 56,
ConfigureButton(this.syncReplayButton, 1218, 265, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, ReplayButton_Click); new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")), (sender, e) => videoPlayerForm.PlayNextSong());
ConfigureButton(this.syncReplayButton, 1218, 265, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")), ReplayButton_Click);
// 有人聲入口位置 // 有人聲入口位置
ConfigureButton(this.syncOriginalSongButton, 1218, 335, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, (sender,e) => videoPlayerForm.ToggleVocalRemoval()); ConfigureButton(this.syncOriginalSongButton, 1218, 335, 205, 56,
ConfigureButton(this.syncMuteButton, 1218, 406, 205, 55, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, MuteUnmuteButton_Click); new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")),
ConfigureButton(this.syncPauseButton, 1218, 475, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, SyncPauseButton_Click); new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")),
ConfigureButton(this.syncPlayButton, 1218, 475, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, SyncPlayButton_Click); new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")), (sender,e) => videoPlayerForm.ToggleVocalRemoval());
ConfigureButton(this.syncVolumeUpButton, 1218, 546, 205, 55, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, null);
ConfigureButton(this.syncMuteButton, 1218, 406, 205, 55,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")), MuteUnmuteButton_Click);
ConfigureButton(this.syncPauseButton, 1218, 475, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), SyncPauseButton_Click);
ConfigureButton(this.syncPlayButton, 1218, 475, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), SyncPlayButton_Click);
ConfigureButton(this.syncVolumeUpButton, 1218, 546, 205, 55,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "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, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, null);
ConfigureButton(this.syncVolumeDownButton, 1218, 616, 205, 55,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "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, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, null);
ConfigureButton(this.syncMicUpButton, 1218, 686, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")),
new Bitmap(Path.Combine(Application.StartupPath, "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, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, null);
ConfigureButton(this.syncMicDownButton, 1218, 756, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")),
new Bitmap(Path.Combine(Application.StartupPath, "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(); };
ConfigureButton(this.syncCloseButton, 1218, 826, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, SyncCloseButton_Click); ConfigureButton(this.syncCloseButton, 1218, 826, 205, 56,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")), SyncCloseButton_Click);

View File

@ -1,8 +1,11 @@
using System.Drawing;
using System.IO; using System.IO;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm : Form
{ {
private Button btnTurnOn; private Button btnTurnOn;
private Button btnTurnOff; private Button btnTurnOff;
private Button btnBright; private Button btnBright;
@ -19,49 +22,58 @@ namespace DualScreenDemo
private Button btnBrightnessDown1; private Button btnBrightnessDown1;
private Button btnBrightnessUp2; private Button btnBrightnessUp2;
private Button btnBrightnessDown2; private Button btnBrightnessDown2;
private int OnOffState;
private PictureBox pictureBoxToggleLight; private PictureBox pictureBoxToggleLight;
private PictureBox Brightness1;
private PictureBox Brightness2;
private void InitializeButtonsForPictureBoxToggleLight() private void InitializeButtonsForPictureBoxToggleLight()
{ {
btnTurnOn = new Button { Text = "" }; btnTurnOn = new Button { Text = "" };
ConfigureButton(btnTurnOn, 29, 45, 250, 67,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
ConfigureButton(btnTurnOn, 604, 410, 122, 62, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
null); null);
btnTurnOn.Click += (sender, e) => btnTurnOn.Click += (sender, e) =>
{ {
if (OnOffState == 1)
if (SerialPortManager.mySerialPort != null && SerialPortManager.mySerialPort.IsOpen) {
SendCommandThroughSerialPort("a2 dc a4");
Console.WriteLine("light off");
OnOffState = 0;
}
if (SerialPortManager.mySerialPort != null && SerialPortManager.mySerialPort.IsOpen && OnOffState!=1)
{ {
byte[] commandBytes = new byte[] { 0xA2, 0xDB, 0xA4 }; byte[] commandBytes = new byte[] { 0xA2, 0xDB, 0xA4 };
Console.WriteLine("light on");
SerialPortManager.mySerialPort.Write(commandBytes, 0, commandBytes.Length); SerialPortManager.mySerialPort.Write(commandBytes, 0, commandBytes.Length);
OnOffState = 1;
} }
else else
{ {
MessageBox.Show("Serial port is not open. Cannot send track correction command."); MessageBox.Show("Serial port is not open. Cannot send track correction command.");
} }
}; };
btnTurnOff = new Button{ Text = "" };
ConfigureButton(btnTurnOff, 753, 411, 122, 62, //btnTurnOff = new Button { Text = "" };
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, //ConfigureButton(btnTurnOff, 753, 411, 122, 62,
null); // resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnTurnOff.Click += (sender, e) => // (sender, e) => SendCommandThroughSerialPort("a2 dc a4"));
{
SendCommandThroughSerialPort("a2 dc a4");
};
btnBright = new Button{ Text = "" }; btnBright = new Button{ Text = "" };
ConfigureButton(btnBright, 295, 45, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")),
ConfigureButton(btnBright, 901, 411, 122, 62, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_明亮.png")),
null); null);
btnBright.Click += (sender, e) => btnBright.Click += (sender, e) =>
{ {
@ -80,209 +92,177 @@ namespace DualScreenDemo
} }
}; };
btnRomantic = new Button{ Text = "" }; btnRomantic = new Button{ Text = "" };
ConfigureButton(btnRomantic, 430, 45, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_浪漫.png")),
ConfigureButton(btnRomantic, 1049, 411, 122, 62, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_浪漫.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "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,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")),
ConfigureButton(btnAuto, 1049, 494, 123, 63, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_自動.png")),
null); null);
btnColorTuning = new Button{ Text = "" }; btnColorTuning = new Button{ Text = "" };
ConfigureButton(btnColorTuning, 430, 203, 118, 65,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_調色.png")),
ConfigureButton(btnColorTuning, 1049, 579, 123, 63, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_調色.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "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,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_柔和.png")),
ConfigureButton(btnSoft, 901, 495, 122, 62, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_柔和.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "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,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_動感.png")),
ConfigureButton(btnDynamic, 901, 579, 123, 62, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_動感.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "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,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_桌燈.png")),
ConfigureButton(btnDeskLamp, 1048, 662, 124, 64, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_桌燈.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "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,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_舞台燈.png")),
ConfigureButton(btnStageLight, 900, 662, 124, 64, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_舞台燈.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "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,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_層板燈.png")),
ConfigureButton(btnShelfLight, 752, 662, 124, 64, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_層板燈.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "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,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")),
ConfigureButton(btnWallLight, 604, 662, 124, 64, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")),
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_壁燈.png")),
(sender, e) => SendCommandThroughSerialPort("a2 f8 a4")); (sender, e) => SendCommandThroughSerialPort("a2 f8 a4"));
Brightness1 = new PictureBox { };
Brightness1.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_桌燈調光.png"));
Brightness1.BackgroundImageLayout = ImageLayout.Stretch;
Brightness1.Size = new Size(155, 172);
Brightness1.Location = new Point(38, 151);
btnBrightnessUp1 = new Button{ Text = "" }; btnBrightnessUp1 = new Button{ Text = "" };
ConfigureTransButton(btnBrightnessUp1, 1, 1, 116, 40, null);
ConfigureButton(btnBrightnessUp1, 603, 495, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
btnBrightnessUp1.MouseDown += (sender, e) => btnBrightnessUp1.MouseDown += (sender, e) =>
{ {
lightControlTimer.Tag = "a2 d9 a4"; lightControlTimer.Tag = "a2 d9 a4";
lightControlTimer.Start(); lightControlTimer.Start();
}; };
btnBrightnessUp1.MouseUp += (sender, e) => btnBrightnessUp1.MouseUp += (sender, e) =>
{ {
lightControlTimer.Stop(); lightControlTimer.Stop();
}; };
btnBrightnessDown1 = new Button{ Text = "" }; btnBrightnessDown1 = new Button{ Text = "" };
ConfigureTransButton(btnBrightnessDown1, 1, 100, 116, 42, null);
ConfigureButton(btnBrightnessDown1, 605, 579, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
btnBrightnessDown1.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 da a4"; lightControlTimer.Start(); }; btnBrightnessDown1.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 da a4"; lightControlTimer.Start(); };
btnBrightnessDown1.MouseUp += (sender, e) => { lightControlTimer.Stop(); }; btnBrightnessDown1.MouseUp += (sender, e) => { lightControlTimer.Stop(); };
Brightness2 = new PictureBox { };
Brightness2.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_層板調光.png"));
Brightness2.BackgroundImageLayout = ImageLayout.Stretch;
Brightness2.Size = new Size(155, 172);
Brightness2.Location = new Point(216, 151);
btnBrightnessUp2 = new Button{ Text = "" }; btnBrightnessUp2 = new Button{ Text = "" };
ConfigureTransButton(btnBrightnessUp2, 1, 1, 116, 42, null);
ConfigureButton(btnBrightnessUp2, 753, 495, 123, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
btnBrightnessUp2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f6 a4"; lightControlTimer.Start(); }; btnBrightnessUp2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f6 a4"; lightControlTimer.Start(); };
btnBrightnessUp2.MouseUp += (sender, e) => { lightControlTimer.Stop(); }; btnBrightnessUp2.MouseUp += (sender, e) => { lightControlTimer.Stop(); };
btnBrightnessDown2 = new Button{ Text = "" }; btnBrightnessDown2 = new Button{ Text = "" };
ConfigureTransButton(btnBrightnessDown2, 1, 100, 116, 42, null);
ConfigureButton(btnBrightnessDown2, 753, 579, 123, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
btnBrightnessDown2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f7 a4"; lightControlTimer.Start(); }; btnBrightnessDown2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f7 a4"; lightControlTimer.Start(); };
btnBrightnessDown2.MouseUp += (sender, e) => { lightControlTimer.Stop(); }; btnBrightnessDown2.MouseUp += (sender, e) => { lightControlTimer.Stop(); };
this.Controls.Add(btnTurnOn); pictureBoxToggleLight.Controls.Add(btnTurnOn);
this.Controls.Add(btnTurnOff); pictureBoxToggleLight.Controls.Add(btnBright);
this.Controls.Add(btnBright); pictureBoxToggleLight.Controls.Add(btnRomantic);
this.Controls.Add(btnRomantic); pictureBoxToggleLight.Controls.Add(btnAuto);
this.Controls.Add(btnAuto); pictureBoxToggleLight.Controls.Add(btnColorTuning);
this.Controls.Add(btnColorTuning); pictureBoxToggleLight.Controls.Add(btnSoft);
this.Controls.Add(btnSoft); pictureBoxToggleLight.Controls.Add(btnDynamic);
this.Controls.Add(btnDynamic); pictureBoxToggleLight.Controls.Add(btnDeskLamp);
this.Controls.Add(btnDeskLamp); pictureBoxToggleLight.Controls.Add(btnStageLight);
this.Controls.Add(btnStageLight); pictureBoxToggleLight.Controls.Add(btnShelfLight);
this.Controls.Add(btnShelfLight); pictureBoxToggleLight.Controls.Add(btnWallLight);
this.Controls.Add(btnWallLight); Brightness1.Controls.Add(btnBrightnessUp1);
this.Controls.Add(btnBrightnessUp1); Brightness1.Controls.Add(btnBrightnessDown1);
this.Controls.Add(btnBrightnessDown1); Brightness2.Controls.Add(btnBrightnessUp2);
this.Controls.Add(btnBrightnessUp2); Brightness2.Controls.Add(btnBrightnessDown2);
this.Controls.Add(btnBrightnessDown2); pictureBoxToggleLight.Controls.Add(Brightness1);
pictureBoxToggleLight.Controls.Add(Brightness2);
} }
private void ToggleLightButton_Click(object sender, EventArgs e) private void ToggleLightButton_Click(object sender, EventArgs e)
{ {
SetHotSongButtonsVisibility(false); //SetHotSongButtonsVisibility(false);
SetNewSongButtonsVisibility(false); //SetNewSongButtonsVisibility(false);
SetSingerSearchButtonsVisibility(false); //SetSingerSearchButtonsVisibility(false);
SetSongSearchButtonsVisibility(false); //SetSongSearchButtonsVisibility(false);
if (!pictureBoxToggleLight.Visible) if (!pictureBoxToggleLight.Visible)
{ {
pictureBoxToggleLight.Size = new Size(630, 379);
ShowImageOnPictureBoxToggleLight(Path.Combine(Application.StartupPath, @"themes\superstar\選單內介面_燈光控制.jpg")); pictureBoxToggleLight.Location = new Point(570, 359);
SetPictureBoxToggleLightAndButtonsVisibility(true); ResizeAndPositionPictureBox(pictureBoxToggleLight, 570, 359, 570, 359);
pictureBoxToggleLight.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_完整介面.png"));
pictureBoxToggleLight.BackgroundImageLayout = ImageLayout.Stretch;
pictureBoxToggleLight.BringToFront();
SetUIVisible(pictureBoxToggleLight);
} }
else else
{ {
CloseUI(pictureBoxToggleLight);
TogglePictureBoxToggleLightButtonsVisibility();
} }
if (pictureBoxQRCode != null) if (pictureBoxQRCode != null)
{ {
pictureBoxQRCode.Visible = false; pictureBoxQRCode.Visible = false;
closeQRCodeButton.Visible = false; //closeQRCodeButton.Visible = false;
} }
} }
private void ShowImageOnPictureBoxToggleLight(string imagePath)
{
try
{
if (!File.Exists(imagePath))
{
MessageBox.Show($"找不到圖片文件: {imagePath}");
return;
}
using (var stream = new MemoryStream(File.ReadAllBytes(imagePath)))
{
var originalImage = new Bitmap(stream);
Rectangle cropArea = new Rectangle(570, 359, 630, 379);
using (var croppedImage = new Bitmap(cropArea.Width, cropArea.Height))
{
using (var g = Graphics.FromImage(croppedImage))
{
g.DrawImage(originalImage,
new Rectangle(0, 0, cropArea.Width, cropArea.Height),
cropArea,
GraphicsUnit.Pixel);
}
pictureBoxToggleLight.Image?.Dispose();
pictureBoxToggleLight.Image = new Bitmap(croppedImage);
}
ResizeAndPositionPictureBox(pictureBoxToggleLight, cropArea.X, cropArea.Y, cropArea.Width, cropArea.Height);
pictureBoxToggleLight.Visible = true;
pictureBoxToggleLight.BringToFront();
}
}
catch (Exception ex)
{
MessageBox.Show($"載入燈光控制圖片時發生錯誤: {ex.Message}\n路徑: {imagePath}");
}
}
private void TogglePictureBoxToggleLightButtonsVisibility()
{
bool areButtonsVisible = pictureBoxToggleLight.Visible;
SetPictureBoxToggleLightAndButtonsVisibility(!areButtonsVisible);
}
private void SetPictureBoxToggleLightAndButtonsVisibility(bool isVisible) private void SetPictureBoxToggleLightAndButtonsVisibility(bool isVisible)
{ {
@ -290,7 +270,7 @@ namespace DualScreenDemo
btnTurnOn.Visible = isVisible; btnTurnOn.Visible = isVisible;
btnTurnOff.Visible = isVisible; //btnTurnOff.Visible = isVisible;
btnBright.Visible = isVisible; btnBright.Visible = isVisible;
btnRomantic.Visible = isVisible; btnRomantic.Visible = isVisible;
btnAuto.Visible = isVisible; btnAuto.Visible = isVisible;
@ -313,7 +293,7 @@ namespace DualScreenDemo
btnTurnOn.BringToFront(); btnTurnOn.BringToFront();
btnTurnOff.BringToFront(); //btnTurnOff.BringToFront();
btnBright.BringToFront(); btnBright.BringToFront();
btnRomantic.BringToFront(); btnRomantic.BringToFront();
btnAuto.BringToFront(); btnAuto.BringToFront();

View File

@ -220,7 +220,6 @@ namespace DualScreenDemo
multiPagePanel.PageIndexChanged += HandlePageChanged; multiPagePanel.PageIndexChanged += HandlePageChanged;
// 添加 Load 事件處理 // 添加 Load 事件處理
this.Load += PrimaryForm_Load; this.Load += PrimaryForm_Load;
} }
// 添加 DPI 感知支持 // 添加 DPI 感知支持
@ -244,15 +243,13 @@ namespace DualScreenDemo
{ {
// 取得本機電腦的主機名稱 (hostname) // 取得本機電腦的主機名稱 (hostname)
string hostName = System.Net.Dns.GetHostName(); string hostName = System.Net.Dns.GetHostName();
string version = Program.verSion;
// 顯示包廂名稱 // 顯示包廂名稱
// 取主機名稱的最後 20 個字元 (如果長度不足 20則取全部) // 取主機名稱的最後 20 個字元 (如果長度不足 20則取全部)
string displayName = "包廂" + hostName.Substring(Math.Max(0, hostName.Length - 3)); string displayName = "包廂" + hostName.Substring(Math.Max(0, hostName.Length - 3));
string totalPages = multiPagePanel.totalPages.ToString() == "0" ? "1" : multiPagePanel.totalPages.ToString(); string totalPages = multiPagePanel.totalPages.ToString() == "0" ? "1" : multiPagePanel.totalPages.ToString();
string pageNumber = (multiPagePanel.currentPageIndex + 1).ToString() + "/" + totalPages; string pageNumber = (multiPagePanel.currentPageIndex + 1).ToString() + "/" + totalPages;
// 最後確定要塗鴉的值
displayName = displayName + " " + pageNumber;
// 基準解析度(你目前的設計基準) // 基準解析度(你目前的設計基準)
float baseWidth = 1920f; float baseWidth = 1920f;
@ -276,13 +273,14 @@ namespace DualScreenDemo
Brush brush = new SolidBrush(Color.Red); Brush brush = new SolidBrush(Color.Red);
// 設定繪製文字的位置 (X=500, Y=30) // 設定繪製文字的位置 (X=500, Y=30)
PointF point_PCName = new PointF(500 * scaleX, 30 * scaleY); PointF point_PCName = new PointF(450 * scaleX, 30 * scaleY);
PointF point_PageNumber = new PointF(1390 * scaleX, 30 * scaleY);
PointF point_verSion = new PointF(1800 * scaleX, 30 * scaleY);
// 繪製文字: // 繪製文字:
// `DrawString(要繪製的文字, 字型, 畫刷, 位置)` // `DrawString(要繪製的文字, 字型, 畫刷, 位置)`
e.Graphics.DrawString(displayName, font, brush, point_PCName); e.Graphics.DrawString(displayName, font, brush, point_PCName);
e.Graphics.DrawString(pageNumber, font, brush, point_PageNumber);
e.Graphics.DrawString(version.Substring(version.IndexOf("V"),4),font,brush, point_verSion);
} }
private void User_Paint(object sender, PaintEventArgs e) private void User_Paint(object sender, PaintEventArgs e)
{ {
@ -467,7 +465,7 @@ namespace DualScreenDemo
string selectedTheme = ReadSelectedThemePath(); string selectedTheme = ReadSelectedThemePath();
if (!string.IsNullOrEmpty(selectedTheme)) if (!string.IsNullOrEmpty(selectedTheme))
{ {
string backgroundImagePath = Path.Combine(Application.StartupPath, "themes\\superstar\\555009.jpg"); string backgroundImagePath = Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\0.下方選單_主畫面.jpg");
try try
{ {
using (Image originalImage = Image.FromFile(backgroundImagePath)) using (Image originalImage = Image.FromFile(backgroundImagePath))
@ -947,7 +945,8 @@ namespace DualScreenDemo
Rectangle cropArea = new Rectangle(button.Location.X, button.Location.Y, button.Size.Width, button.Size.Height); Rectangle cropArea = new Rectangle(button.Location.X, button.Location.Y, button.Size.Width, button.Size.Height);
button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat); //button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
button.BackgroundImage = normalStateImage;
button.BackgroundImageLayout = ImageLayout.Stretch; button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat; button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0; button.FlatAppearance.BorderSize = 0;
@ -955,140 +954,226 @@ namespace DualScreenDemo
button.FlatAppearance.MouseOverBackColor = Color.Transparent; button.FlatAppearance.MouseOverBackColor = Color.Transparent;
button.MouseEnter += (sender, e) => button.BackgroundImage = mouseOverImage.Clone(cropArea, mouseOverImage.PixelFormat); //button.MouseEnter += (sender, e) => button.BackgroundImage = mouseOverImage.Clone(cropArea, mouseOverImage.PixelFormat);
button.MouseLeave += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat); //button.MouseLeave += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
button.MouseDown += (sender, e) => button.BackgroundImage = mouseDownImage.Clone(cropArea, mouseDownImage.PixelFormat); //button.MouseDown += (sender, e) => button.BackgroundImage = mouseDownImage.Clone(cropArea, mouseDownImage.PixelFormat);
button.MouseUp += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat); //button.MouseUp += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
button.MouseEnter += (sender, e) => button.BackgroundImage = mouseOverImage;
button.MouseLeave += (sender, e) => button.BackgroundImage = normalStateImage;
button.MouseDown += (sender, e) => button.BackgroundImage = mouseDownImage;
button.MouseUp += (sender, e) => button.BackgroundImage = normalStateImage;
if (clickEventHandler != null) if (clickEventHandler != null)
{ {
button.Click += clickEventHandler; button.Click += clickEventHandler;
} }
button.AutoSize = true;
this.Controls.Add(button);
}
private void ConfigureTransButton(Button button, int posX, int posY, int width, int height,
EventHandler clickEventHandler)
{
ResizeAndPositionButton(button, posX, posY, width, height);
button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0;
button.FlatAppearance.MouseOverBackColor = Color.Transparent;
button.FlatAppearance.MouseDownBackColor = Color.Transparent;
button.BackColor = Color.Transparent;
if (clickEventHandler != null)
{
button.Click += clickEventHandler;
}
this.Controls.Add(button); this.Controls.Add(button);
} }
private void InitializeOtherControls() private void InitializeOtherControls()
{ {
InitializeButton(ref newSongAlertButton, ref newSongAlertNormalBackground, ref newSongAlertActiveBackground, "newSongAlertButton", 25, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_新歌快報X.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", 143, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_熱門排行-02.png", HotPlayButton_Click); InitializeButton(ref hotPlayButton, ref hotPlayNormalBackground, ref hotPlayActiveBackground, "hotPlayButton", 137, 98, 106, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_熱門排行(未按).png", HotPlayButton_Click);
InitializeButton(ref singerSearchButton, ref singerSearchNormalBackground, ref singerSearchActiveBackground, "singerSearchButton", 261, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_歌星查詢-03.png", SingerSearchButton_Click); InitializeButton(ref singerSearchButton, ref singerSearchNormalBackground, ref singerSearchActiveBackground, "singerSearchButton", 255, 98, 106, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_歌星查詢(未按).png", SingerSearchButton_Click);
InitializeButton(ref songSearchButton, ref songSearchNormalBackground, ref songSearchActiveBackground, "songSearchButton", 378, 97, 100, 99, "themes\\superstar\\ICON上方\\上方ICON_歌名查詢-04.png", SongSearchButton_Click); InitializeButton(ref songSearchButton, ref songSearchNormalBackground, ref songSearchActiveBackground, "songSearchButton", 373, 98, 106, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_歌名查詢(未按).png", SongSearchButton_Click);
InitializeButton(ref languageSearchButton, ref languageSearchNormalBackground, ref languageSearchActiveBackground, "languageSearchButton", 496, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_語別查詢-05.png", LanguageSongSelectionButton_Click); InitializeButton(ref languageSearchButton, ref languageSearchNormalBackground, ref languageSearchActiveBackground, "languageSearchButton", 491, 98, 106, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_語別查詢(未按).png", LanguageSongSelectionButton_Click);
InitializeButton(ref groupSearchButton, ref groupSearchNormalBackground, ref groupSearchActiveBackground, "groupSearchButton", 614, 97, 99, 100, "themes\\superstar\\ICON上方\\上方ICON_合唱查詢-06.png", GroupSongSelectionButton_Click); InitializeButton(ref groupSearchButton, ref groupSearchNormalBackground, ref groupSearchActiveBackground, "groupSearchButton", 608, 98, 106, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_合唱查詢(未按).png", GroupSongSelectionButton_Click);
InitializeButton(ref categorySearchButton, ref categorySearchNormalBackground, ref categorySearchActiveBackground, "categorySearchButton", 731, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_類別查詢-07.png", CategorySearchButton_Click); InitializeButton(ref categorySearchButton, ref categorySearchNormalBackground, ref categorySearchActiveBackground, "categorySearchButton", 726, 98, 106, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_類別查詢(未按).png", CategorySearchButton_Click);
Bitmap serviceBell = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(未按).png"));
Bitmap serviceBellHover = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(已按).png"));
//serviceBellButton = new Button { Text = "" };
//serviceBellButton.Name = "serviceBellButton";
//ConfigureButton(serviceBellButton, 848, 96, 101, 102,
// resizedMouseOverImage, resizedMouseOverImage, resizedMouseDownImage,
// (sender, e) => OnServiceBellButtonClick(sender, e));
//this.Controls.Add(serviceBellButton);
Rectangle serviceBellButtonCropArea = new Rectangle(843, 98, 107, 120);
InitializeButton(
ref serviceBellButton,
"serviceBellButton",
843, 98, 107, 120,
serviceBellButtonCropArea,
serviceBell,
(sender, e) => OnServiceBellButtonClick(sender, e)
);
serviceBellButton.MouseEnter += (sender, e) => serviceBellButton.BackgroundImage = serviceBellHover;
serviceBellButton.MouseLeave += (sender, e) => serviceBellButton.BackgroundImage = serviceBell;
serviceBellButton = new Button { Text = "" }; InitializeButton(ref orderedSongsButton, ref orderedSongsNormalBackground, ref orderedSongsActiveBackground, "orderedSongsButton", 961, 98, 107, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_已點歌曲(未按).png", OrderedSongsButton_Click);
serviceBellButton.Name = "serviceBellButton";
ConfigureButton(serviceBellButton, 848, 96, 101, 102,
resizedNormalStateImage, resizedMouseOverImage, resizedMouseDownImage,
(sender, e) => OnServiceBellButtonClick(sender, e));
this.Controls.Add(serviceBellButton); InitializeButton(ref myFavoritesButton, ref myFavoritesNormalBackground, ref myFavoritesActiveBackground, "myFavoritesButton", 1079, 98, 107, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_我的最愛(未按).png", MyFavoritesButton_Click);
InitializeButton(ref orderedSongsButton, ref orderedSongsNormalBackground, ref orderedSongsActiveBackground, "orderedSongsButton", 966, 97, 100, 99, "themes\\superstar\\ICON上方\\上方ICON_已點歌曲-09.png", OrderedSongsButton_Click); InitializeButton(ref promotionsButton, ref promotionsNormalBackground, ref promotionsActiveBackground, "promotionsButton", 1197, 98, 107, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_優惠活動(未按).png", promotionsButton_Click);
InitializeButton(ref myFavoritesButton, ref myFavoritesNormalBackground, ref myFavoritesActiveBackground, "myFavoritesButton", 1084, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_我的最愛-10.png", MyFavoritesButton_Click); InitializeButton(ref deliciousFoodButton, ref deliciousFoodNormalBackground, ref deliciousFoodActiveBackground, "deliciousFoodButton", 1315, 98, 107, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_美味菜單(未按).png", DeliciousFoodButton_Click);
InitializeButton(ref promotionsButton, ref promotionsNormalBackground, ref promotionsActiveBackground, "promotionsButton", 1202, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_優惠活動-11.png", promotionsButton_Click); //mobileSongRequestButton = new Button { Text = "" };
//mobileSongRequestButton.Name = "mobileSongRequestButton";
//ConfigureButton(mobileSongRequestButton, 1211, 669, 210, 70,
// resizedNormalStateImage, resizedMouseOverImage, resizedMouseDownImage,
// MobileSongRequestButton_Click);
InitializeButton(ref deliciousFoodButton, ref deliciousFoodNormalBackground, ref deliciousFoodActiveBackground, "deliciousFoodButton", 1320, 97, 98, 99, "themes\\superstar\\ICON上方\\上方ICON_美味菜單-12.png", DeliciousFoodButton_Click); Bitmap mobileSongRequest = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png"));
mobileSongRequestButton = new Button { Text = "" }; Rectangle mobileSongRequestButtonCropArea = new Rectangle(1198, 629, 223, 88);
mobileSongRequestButton.Name = "mobileSongRequestButton"; InitializeButton(
ConfigureButton(mobileSongRequestButton, 1211, 669, 210, 70, ref mobileSongRequestButton,
resizedNormalStateImage, resizedMouseOverImage, resizedMouseDownImage, "mobileSongRequestButton",
MobileSongRequestButton_Click); 1198, 629, 223, 88,
mobileSongRequestButtonCropArea,
mobileSongRequest,
MobileSongRequestButton_Click
);
qieGeButton = new Button{ Text = "" };
qieGeButton.Name = "qieGeButton"; Bitmap qieGe=new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png"));
ConfigureButton(qieGeButton, 28, 755, 92, 132,
resizedNormalStateImage, resizedNormalStateImage, resizedNormalStateImage, Rectangle qieGeButtonCropArea = new Rectangle(20, 738, 92, 147);
(sender, e) => videoPlayerForm.PlayNextSong()); InitializeButton(
ref qieGeButton,
"qieGeButton",
20, 738, 92, 147,
qieGeButtonCropArea,
qieGe,
(sender, e) => videoPlayerForm.PlayNextSong()
);
this.Controls.Add(qieGeButton); this.Controls.Add(qieGeButton);
musicUpButton = new Button{ Text = "" }; musicUpButton = new Button{ Text = "" };
musicUpButton.Name = "musicUpButton"; musicUpButton.Name = "musicUpButton";
ResizeAndPositionButton(musicUpButton, 136, 754, 92, 58); ResizeAndPositionButton(musicUpButton, 128, 738, 93, 62);
Rectangle musicUpButtonCropArea = new Rectangle(136, 754, 92, 58); Rectangle musicUpButtonCropArea = new Rectangle(128, 738, 93, 62);
musicUpButton.BackgroundImage = normalStateImage.Clone(musicUpButtonCropArea, normalStateImage.PixelFormat); //musicUpButton.BackgroundImage = normalStateImage.Clone(musicUpButtonCropArea, normalStateImage.PixelFormat);
musicUpButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂+.png"));
//musicUpButton.BackColor = Color.Transparent;
musicUpButton.BackgroundImageLayout = ImageLayout.Stretch; musicUpButton.BackgroundImageLayout = ImageLayout.Stretch;
musicUpButton.FlatStyle = FlatStyle.Flat; musicUpButton.FlatStyle = FlatStyle.Flat;
musicUpButton.FlatAppearance.BorderSize = 0; musicUpButton.FlatAppearance.BorderSize = 0;
//musicUpButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//musicUpButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
musicUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑","a2 b3 a4"); }; musicUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑","a2 b3 a4"); };
musicUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); }; musicUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
musicUpButton.MouseLeave += (sender, e) => musicUpButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂+.png"));
musicUpButton.MouseDown += (sender, e) => musicUpButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_音樂++.png"));
this.Controls.Add(musicUpButton); this.Controls.Add(musicUpButton);
musicDownButton = new Button{ Text = "" }; musicDownButton = new Button{ Text = "" };
musicDownButton.Name = "musicDownButton"; musicDownButton.Name = "musicDownButton";
ResizeAndPositionButton(musicDownButton, 136, 827, 92, 57); ResizeAndPositionButton(musicDownButton, 128, 823, 93, 62);
Rectangle musicDownButtonCropArea = new Rectangle(136, 827, 92, 57); Rectangle musicDownButtonCropArea = new Rectangle(128, 823, 93, 62);
musicDownButton.BackgroundImage = normalStateImage.Clone(musicDownButtonCropArea, normalStateImage.PixelFormat); //musicDownButton.BackgroundImage = normalStateImage.Clone(musicDownButtonCropArea, normalStateImage.PixelFormat);
musicDownButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂-.png"));
//musicDownButton.BackColor = Color.Transparent;
musicDownButton.BackgroundImageLayout = ImageLayout.Stretch; musicDownButton.BackgroundImageLayout = ImageLayout.Stretch;
musicDownButton.FlatStyle = FlatStyle.Flat; musicDownButton.FlatStyle = FlatStyle.Flat;
musicDownButton.FlatAppearance.BorderSize = 0; musicDownButton.FlatAppearance.BorderSize = 0;
//musicDownButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//musicDownButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
musicDownButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓","a2 b4 a4"); }; musicDownButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓","a2 b4 a4"); };
musicDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); }; musicDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
musicDownButton.MouseLeave += (sender, e) => musicDownButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂-.png"));
musicDownButton.MouseDown += (sender, e) => musicDownButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_音樂--.png"));
this.Controls.Add(musicDownButton); this.Controls.Add(musicDownButton);
micUpButton = new Button{ Text = "" }; micUpButton = new Button{ Text = "" };
micUpButton.Name = "micUpButton"; micUpButton.Name = "micUpButton";
ResizeAndPositionButton(micUpButton, 244, 754, 92, 57); ResizeAndPositionButton(micUpButton, 238, 738, 93, 62);
Rectangle micUpButtonCropArea = new Rectangle(244, 754, 92, 57); Rectangle micUpButtonCropArea = new Rectangle(238, 738, 93, 62);
micUpButton.BackgroundImage = normalStateImage.Clone(micUpButtonCropArea, normalStateImage.PixelFormat); //micUpButton.BackgroundImage = normalStateImage.Clone(micUpButtonCropArea, normalStateImage.PixelFormat);
micUpButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風+.png"));
//micUpButton.BackColor = Color.Transparent;
micUpButton.BackgroundImageLayout = ImageLayout.Stretch; micUpButton.BackgroundImageLayout = ImageLayout.Stretch;
micUpButton.FlatStyle = FlatStyle.Flat; micUpButton.FlatStyle = FlatStyle.Flat;
micUpButton.FlatAppearance.BorderSize = 0; micUpButton.FlatAppearance.BorderSize = 0;
//micUpButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//micUpButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
micUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑","a2 b5 a4"); }; micUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑","a2 b5 a4"); };
micUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); }; micUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
micUpButton.MouseLeave += (sender, e) => micUpButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風+.png"));
micUpButton.MouseDown += (sender, e) => micUpButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_麥克風++.png"));
this.Controls.Add(micUpButton); this.Controls.Add(micUpButton);
micDownButton = new Button{ Text = "" }; micDownButton = new Button{ Text = "" };
micDownButton.Name = "micDownButton"; micDownButton.Name = "micDownButton";
ResizeAndPositionButton(micDownButton, 244, 827, 92, 57); ResizeAndPositionButton(micDownButton, 238, 823, 93, 62);
Rectangle micDownButtonCropArea = new Rectangle(244, 827, 92, 57); Rectangle micDownButtonCropArea = new Rectangle(238, 823, 93, 62);
micDownButton.BackgroundImage = normalStateImage.Clone(micDownButtonCropArea, normalStateImage.PixelFormat); //micDownButton.BackgroundImage = normalStateImage.Clone(micDownButtonCropArea, normalStateImage.PixelFormat);
micDownButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風-.png"));
//micDownButton.BackColor = Color.Transparent;
micDownButton.BackgroundImageLayout = ImageLayout.Stretch; micDownButton.BackgroundImageLayout = ImageLayout.Stretch;
micDownButton.FlatStyle = FlatStyle.Flat; micDownButton.FlatStyle = FlatStyle.Flat;
micDownButton.FlatAppearance.BorderSize = 0; micDownButton.FlatAppearance.BorderSize = 0;
//micDownButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//micDownButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
micDownButton.MouseDown += (sender, e) =>{ OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓","a2 b6 a4"); }; micDownButton.MouseDown += (sender, e) =>{ OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓","a2 b6 a4"); };
micDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); }; micDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
micDownButton.MouseLeave += (sender, e) => micDownButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風-.png"));
micDownButton.MouseDown += (sender, e) => micDownButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_麥克風--.png"));
this.Controls.Add(micDownButton); this.Controls.Add(micDownButton);
originalSongButton = new Button { Text = "" }; originalSongButton = new Button { Text = "" };
originalSongButton.Name = "originalSongButton"; originalSongButton.Name = "originalSongButton";
ResizeAndPositionButton(originalSongButton, 353, 756, 91, 55); ResizeAndPositionButton(originalSongButton, 347, 738, 93, 62);
Rectangle originalSongButtonCropArea = new Rectangle(353, 756, 91, 55); Rectangle originalSongButtonCropArea = new Rectangle(347, 738, 93, 62);
originalSongButton.BackgroundImage = normalStateImage.Clone(originalSongButtonCropArea, normalStateImage.PixelFormat); //originalSongButton.BackgroundImage = normalStateImage.Clone(originalSongButtonCropArea, normalStateImage.PixelFormat);
originalSongButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png"));
//originalSongButton.BackColor = Color.Transparent;
originalSongButton.BackgroundImageLayout = ImageLayout.Stretch; originalSongButton.BackgroundImageLayout = ImageLayout.Stretch;
originalSongButton.FlatStyle = FlatStyle.Flat; originalSongButton.FlatStyle = FlatStyle.Flat;
originalSongButton.FlatAppearance.BorderSize = 0; originalSongButton.FlatAppearance.BorderSize = 0;
//originalSongButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//originalSongButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
originalSongButton.Click += OriginalSongButton_Click; originalSongButton.Click += OriginalSongButton_Click;
this.Controls.Add(originalSongButton); this.Controls.Add(originalSongButton);
replayButton = new Button{ Text = "" }; replayButton = new Button{ Text = "" };
replayButton.Name = "replayButton"; replayButton.Name = "replayButton";
ResizeAndPositionButton(replayButton, 353, 828, 91, 55); ResizeAndPositionButton(replayButton, 347, 823, 93, 62);
Rectangle replayButtonCropArea = new Rectangle(353, 828, 91, 55); Rectangle replayButtonCropArea = new Rectangle(347, 823, 93, 62);
replayButton.BackgroundImage = normalStateImage.Clone(replayButtonCropArea, normalStateImage.PixelFormat); //replayButton.BackgroundImage = normalStateImage.Clone(replayButtonCropArea, normalStateImage.PixelFormat);
replayButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png"));
//replayButton.BackColor = Color.Transparent;
replayButton.BackgroundImageLayout = ImageLayout.Stretch; replayButton.BackgroundImageLayout = ImageLayout.Stretch;
replayButton.FlatStyle = FlatStyle.Flat; replayButton.FlatStyle = FlatStyle.Flat;
replayButton.FlatAppearance.BorderSize = 0; replayButton.FlatAppearance.BorderSize = 0;
//replayButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//replayButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
replayButton.Click += ReplayButton_Click; replayButton.Click += ReplayButton_Click;
this.Controls.Add(replayButton); this.Controls.Add(replayButton);
@ -1097,12 +1182,16 @@ namespace DualScreenDemo
Text = "", Text = "",
Name = "pauseButton" Name = "pauseButton"
}; };
ResizeAndPositionButton(pauseButton, 461, 755, 91, 56); ResizeAndPositionButton(pauseButton, 456, 738, 93, 62);
Rectangle pauseButtonCropArea = new Rectangle(461, 755, 91, 56); Rectangle pauseButtonCropArea = new Rectangle(456, 738, 93, 62);
pauseButton.BackgroundImage = normalStateImage.Clone(pauseButtonCropArea, normalStateImage.PixelFormat); //pauseButton.BackgroundImage = normalStateImage.Clone(pauseButtonCropArea, normalStateImage.PixelFormat);
pauseButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png"));
//pauseButton.BackColor = Color.Transparent;
pauseButton.BackgroundImageLayout = ImageLayout.Stretch; pauseButton.BackgroundImageLayout = ImageLayout.Stretch;
pauseButton.FlatStyle = FlatStyle.Flat; pauseButton.FlatStyle = FlatStyle.Flat;
pauseButton.FlatAppearance.BorderSize = 0; pauseButton.FlatAppearance.BorderSize = 0;
//pauseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//pauseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
pauseButton.Click += PauseButton_Click; pauseButton.Click += PauseButton_Click;
this.Controls.Add(pauseButton); this.Controls.Add(pauseButton);
@ -1112,134 +1201,173 @@ namespace DualScreenDemo
Name = "playButton", Name = "playButton",
Visible = false Visible = false
}; };
ResizeAndPositionButton(playButton, 461, 755, 91, 56); ResizeAndPositionButton(playButton, 456, 738, 93, 62);
Rectangle playButtonCropArea = new Rectangle(461, 755, 91, 56); Rectangle playButtonCropArea = new Rectangle(456, 740, 93, 62);
playButton.BackgroundImage = normalStateImage.Clone(playButtonCropArea, normalStateImage.PixelFormat); //playButton.BackgroundImage = normalStateImage.Clone(playButtonCropArea, normalStateImage.PixelFormat);
playButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png"));
//playButton.BackColor = Color.Transparent;
playButton.BackgroundImageLayout = ImageLayout.Stretch; playButton.BackgroundImageLayout = ImageLayout.Stretch;
playButton.FlatStyle = FlatStyle.Flat; playButton.FlatStyle = FlatStyle.Flat;
playButton.FlatAppearance.BorderSize = 0; playButton.FlatAppearance.BorderSize = 0;
//playButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//playButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
playButton.Click += PlayButton_Click; playButton.Click += PlayButton_Click;
this.Controls.Add(playButton); this.Controls.Add(playButton);
muteButton = new Button{ Text = "" }; muteButton = new Button{ Text = "" };
muteButton.Name = "muteButton"; muteButton.Name = "muteButton";
ResizeAndPositionButton(muteButton, 461, 828, 91, 55); ResizeAndPositionButton(muteButton, 456, 823, 93, 62);
Rectangle muteButtonCropArea = new Rectangle(461, 828, 91, 55); Rectangle muteButtonCropArea = new Rectangle(456, 823, 93, 62);
muteButton.BackgroundImage = normalStateImage.Clone(muteButtonCropArea, normalStateImage.PixelFormat); //muteButton.BackgroundImage = normalStateImage.Clone(muteButtonCropArea, normalStateImage.PixelFormat);
muteButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png"));
//muteButton.BackColor = Color.Transparent;
muteButton.BackgroundImageLayout = ImageLayout.Stretch; muteButton.BackgroundImageLayout = ImageLayout.Stretch;
muteButton.FlatStyle = FlatStyle.Flat; muteButton.FlatStyle = FlatStyle.Flat;
muteButton.FlatAppearance.BorderSize = 0; muteButton.FlatAppearance.BorderSize = 0;
//muteButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//muteButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
muteButton.Click += MuteUnmuteButton_Click; muteButton.Click += MuteUnmuteButton_Click;
this.Controls.Add(muteButton); this.Controls.Add(muteButton);
maleKeyButton = new Button{ Text = "" }; maleKeyButton = new Button{ Text = "" };
maleKeyButton.Name = "maleKeyButton"; maleKeyButton.Name = "maleKeyButton";
ResizeAndPositionButton(maleKeyButton, 569, 755, 91, 56); ResizeAndPositionButton(maleKeyButton, 564, 738, 93, 62);
Rectangle maleKeyButtonCropArea = new Rectangle(569, 755, 91, 56); Rectangle maleKeyButtonCropArea = new Rectangle(564, 738, 93, 62);
maleKeyButton.BackgroundImage = normalStateImage.Clone(maleKeyButtonCropArea, normalStateImage.PixelFormat); //maleKeyButton.BackgroundImage = normalStateImage.Clone(maleKeyButtonCropArea, normalStateImage.PixelFormat);
maleKeyButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png"));
//maleKeyButton.BackColor = Color.Transparent;
maleKeyButton.BackgroundImageLayout = ImageLayout.Stretch; maleKeyButton.BackgroundImageLayout = ImageLayout.Stretch;
maleKeyButton.FlatStyle = FlatStyle.Flat; maleKeyButton.FlatStyle = FlatStyle.Flat;
maleKeyButton.Click += MaleKeyButton_Click; maleKeyButton.Click += MaleKeyButton_Click;
maleKeyButton.FlatAppearance.BorderSize = 0; maleKeyButton.FlatAppearance.BorderSize = 0;
//maleKeyButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//maleKeyButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
this.Controls.Add(maleKeyButton); this.Controls.Add(maleKeyButton);
femaleKeyButton = new Button{ Text = "" }; femaleKeyButton = new Button{ Text = "" };
femaleKeyButton.Name = "femaleKeyButton"; femaleKeyButton.Name = "femaleKeyButton";
ResizeAndPositionButton(femaleKeyButton, 570, 828, 90, 55); ResizeAndPositionButton(femaleKeyButton, 565, 823, 93, 62);
Rectangle femaleKeyButtonCropArea = new Rectangle(570, 828, 90, 55); Rectangle femaleKeyButtonCropArea = new Rectangle(565, 823, 93, 62);
femaleKeyButton.BackgroundImage = normalStateImage.Clone(femaleKeyButtonCropArea, normalStateImage.PixelFormat); //femaleKeyButton.BackgroundImage = normalStateImage.Clone(femaleKeyButtonCropArea, normalStateImage.PixelFormat);
femaleKeyButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png"));
//femaleKeyButton.BackColor = Color.Transparent;
femaleKeyButton.BackgroundImageLayout = ImageLayout.Stretch; femaleKeyButton.BackgroundImageLayout = ImageLayout.Stretch;
femaleKeyButton.FlatStyle = FlatStyle.Flat; femaleKeyButton.FlatStyle = FlatStyle.Flat;
femaleKeyButton.FlatAppearance.BorderSize = 0; femaleKeyButton.FlatAppearance.BorderSize = 0;
//femaleKeyButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//femaleKeyButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
femaleKeyButton.Click += FemaleKeyButton_Click; femaleKeyButton.Click += FemaleKeyButton_Click;
this.Controls.Add(femaleKeyButton); this.Controls.Add(femaleKeyButton);
standardKeyButton = new Button { Text = "" }; standardKeyButton = new Button { Text = "" };
standardKeyButton.Name = "standardKeyButton"; standardKeyButton.Name = "standardKeyButton";
ResizeAndPositionButton(standardKeyButton, 677, 757, 91, 56); ResizeAndPositionButton(standardKeyButton, 674, 738, 93, 62);
Rectangle standardKeyButtonCropArea = new Rectangle(677, 757, 91, 56); Rectangle standardKeyButtonCropArea = new Rectangle(674, 738, 93, 62);
standardKeyButton.BackgroundImage = normalStateImage.Clone(standardKeyButtonCropArea, normalStateImage.PixelFormat); //standardKeyButton.BackgroundImage = normalStateImage.Clone(standardKeyButtonCropArea, normalStateImage.PixelFormat);
standardKeyButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png"));
//standardKeyButton.BackColor = Color.Transparent;
standardKeyButton.BackgroundImageLayout = ImageLayout.Stretch; standardKeyButton.BackgroundImageLayout = ImageLayout.Stretch;
standardKeyButton.FlatStyle = FlatStyle.Flat; standardKeyButton.FlatStyle = FlatStyle.Flat;
standardKeyButton.FlatAppearance.BorderSize = 0; standardKeyButton.FlatAppearance.BorderSize = 0;
//standardKeyButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//standardKeyButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
standardKeyButton.Click += StandardKeyButton_Click; standardKeyButton.Click += StandardKeyButton_Click;
this.Controls.Add(standardKeyButton); this.Controls.Add(standardKeyButton);
soundEffectButton = new Button { Text = "" }; soundEffectButton = new Button { Text = "" };
soundEffectButton.Name = "soundEffectButton"; soundEffectButton.Name = "soundEffectButton";
ResizeAndPositionButton(soundEffectButton, 677, 827, 91, 56); ResizeAndPositionButton(soundEffectButton, 674, 823, 93, 62);
Rectangle soundEffectButtonCropArea = new Rectangle(677, 827, 91, 56); Rectangle soundEffectButtonCropArea = new Rectangle(674, 823, 93, 62);
soundEffectButton.BackgroundImage = normalStateImage.Clone(soundEffectButtonCropArea, normalStateImage.PixelFormat); //soundEffectButton.BackgroundImage = normalStateImage.Clone(soundEffectButtonCropArea, normalStateImage.PixelFormat);
soundEffectButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png"));
//soundEffectButton.BackColor = Color.Transparent;
soundEffectButton.BackgroundImageLayout = ImageLayout.Stretch; soundEffectButton.BackgroundImageLayout = ImageLayout.Stretch;
soundEffectButton.FlatStyle = FlatStyle.Flat; soundEffectButton.FlatStyle = FlatStyle.Flat;
soundEffectButton.FlatAppearance.BorderSize = 0; soundEffectButton.FlatAppearance.BorderSize = 0;
//soundEffectButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//soundEffectButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
soundEffectButton.Click += SoundEffectButton_Click; soundEffectButton.Click += SoundEffectButton_Click;
this.Controls.Add(soundEffectButton); this.Controls.Add(soundEffectButton);
pitchUpButton = new Button{ Text = "" }; pitchUpButton = new Button{ Text = "" };
pitchUpButton.Name = "pitchUpButton"; pitchUpButton.Name = "pitchUpButton";
ResizeAndPositionButton(pitchUpButton, 786, 755, 90, 56); ResizeAndPositionButton(pitchUpButton, 784, 738, 93, 62);
Rectangle pitchUpButtonCropArea = new Rectangle(786, 755, 90, 56); Rectangle pitchUpButtonCropArea = new Rectangle(784, 738, 93, 62);
pitchUpButton.BackgroundImage = normalStateImage.Clone(pitchUpButtonCropArea, normalStateImage.PixelFormat); //pitchUpButton.BackgroundImage = normalStateImage.Clone(pitchUpButtonCropArea, normalStateImage.PixelFormat);
pitchUpButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png"));
//pitchUpButton.BackColor = Color.Transparent;
pitchUpButton.BackgroundImageLayout = ImageLayout.Stretch; pitchUpButton.BackgroundImageLayout = ImageLayout.Stretch;
pitchUpButton.FlatStyle = FlatStyle.Flat; pitchUpButton.FlatStyle = FlatStyle.Flat;
pitchUpButton.FlatAppearance.BorderSize = 0; pitchUpButton.FlatAppearance.BorderSize = 0;
//pitchUpButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//pitchUpButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
pitchUpButton.Click += PitchUpButton_Click; pitchUpButton.Click += PitchUpButton_Click;
this.Controls.Add(pitchUpButton); this.Controls.Add(pitchUpButton);
pitchDownButton = new Button{ Text = "" }; pitchDownButton = new Button{ Text = "" };
pitchDownButton.Name = "pitchDownButton"; pitchDownButton.Name = "pitchDownButton";
ResizeAndPositionButton(pitchDownButton, 786, 828, 90, 55); ResizeAndPositionButton(pitchDownButton, 784, 823, 93, 62);
Rectangle pitchDownButtonCropArea = new Rectangle(786, 828, 90, 55); Rectangle pitchDownButtonCropArea = new Rectangle(784, 823, 93, 62);
pitchDownButton.BackgroundImage = normalStateImage.Clone(pitchDownButtonCropArea, normalStateImage.PixelFormat); //pitchDownButton.BackgroundImage = normalStateImage.Clone(pitchDownButtonCropArea, normalStateImage.PixelFormat);
pitchDownButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png"));
//pitchDownButton.BackColor = Color.Transparent;
pitchDownButton.BackgroundImageLayout = ImageLayout.Stretch; pitchDownButton.BackgroundImageLayout = ImageLayout.Stretch;
pitchDownButton.FlatStyle = FlatStyle.Flat; pitchDownButton.FlatStyle = FlatStyle.Flat;
pitchDownButton.FlatAppearance.BorderSize = 0; pitchDownButton.FlatAppearance.BorderSize = 0;
//pitchDownButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//pitchDownButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
pitchDownButton.Click += PitchDownButton_Click; pitchDownButton.Click += PitchDownButton_Click;
this.Controls.Add(pitchDownButton); this.Controls.Add(pitchDownButton);
syncScreenButton = new Button { Text = "" }; syncScreenButton = new Button { Text = "" };
syncScreenButton.Name = "syncScreenButton"; syncScreenButton.Name = "syncScreenButton";
ResizeAndPositionButton(syncScreenButton, 893, 754, 93, 133); ResizeAndPositionButton(syncScreenButton, 893, 736, 92, 149);
Rectangle syncScreenButtonCropArea = new Rectangle(893, 754, 93, 133); Rectangle syncScreenButtonCropArea = new Rectangle(893, 736, 92, 149);
syncScreenButton.BackgroundImage = normalStateImage.Clone(syncScreenButtonCropArea, normalStateImage.PixelFormat); //syncScreenButton.BackgroundImage = normalStateImage.Clone(syncScreenButtonCropArea, normalStateImage.PixelFormat);
syncScreenButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png"));
//syncScreenButton.BackColor = Color.Transparent;
syncScreenButton.BackgroundImageLayout = ImageLayout.Stretch; syncScreenButton.BackgroundImageLayout = ImageLayout.Stretch;
syncScreenButton.FlatStyle = FlatStyle.Flat; syncScreenButton.FlatStyle = FlatStyle.Flat;
syncScreenButton.FlatAppearance.BorderSize = 0; syncScreenButton.FlatAppearance.BorderSize = 0;
//syncScreenButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//syncScreenButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
syncScreenButton.Click += SyncScreenButton_Click; syncScreenButton.Click += SyncScreenButton_Click;
this.Controls.Add(syncScreenButton); this.Controls.Add(syncScreenButton);
toggleLightButton = new Button{ Text = "" }; toggleLightButton = new Button{ Text = "" };
toggleLightButton.Name = "toggleLightButton"; toggleLightButton.Name = "toggleLightButton";
ResizeAndPositionButton(toggleLightButton, 1002, 756, 91, 130); ResizeAndPositionButton(toggleLightButton, 1002, 736, 92, 149);
Rectangle toggleLightButtonCropArea = new Rectangle(1002, 756, 91, 130); Rectangle toggleLightButtonCropArea = new Rectangle(1002, 736, 92, 149);
toggleLightButton.BackgroundImage = normalStateImage.Clone(toggleLightButtonCropArea, normalStateImage.PixelFormat); //toggleLightButton.BackgroundImage = normalStateImage.Clone(toggleLightButtonCropArea, normalStateImage.PixelFormat);
toggleLightButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png"));
//toggleLightButton.BackColor = Color.Transparent;
toggleLightButton.BackgroundImageLayout = ImageLayout.Stretch; toggleLightButton.BackgroundImageLayout = ImageLayout.Stretch;
toggleLightButton.FlatStyle = FlatStyle.Flat; toggleLightButton.FlatStyle = FlatStyle.Flat;
toggleLightButton.FlatAppearance.BorderSize = 0; toggleLightButton.FlatAppearance.BorderSize = 0;
//toggleLightButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
//toggleLightButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
toggleLightButton.Click += ToggleLightButton_Click; toggleLightButton.Click += ToggleLightButton_Click;
this.Controls.Add(toggleLightButton); this.Controls.Add(toggleLightButton);
Bitmap PPage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png"));
Rectangle previousPageButtonCropArea = new Rectangle(1109, 754, 93, 58); Rectangle previousPageButtonCropArea = new Rectangle(1110, 738, 93, 62);
InitializeButton( InitializeButton(
ref btnPreviousPage, ref btnPreviousPage,
"btnPreviousPage", "btnPreviousPage",
1109, 754, 93, 58, 1111, 738, 93, 62,
previousPageButtonCropArea, previousPageButtonCropArea,
normalStateImage, PPage,
PreviousPageButton_Click PreviousPageButton_Click
); );
@ -1247,58 +1375,65 @@ namespace DualScreenDemo
btnReturn = new Button{ Text = "" }; btnReturn = new Button{ Text = "" };
btnReturn.Name = "btnReturn"; btnReturn.Name = "btnReturn";
ResizeAndPositionButton(btnReturn, 1218, 755, 92, 57); ResizeAndPositionButton(btnReturn, 1220, 738, 93, 62);
Rectangle returnButtonCropArea = new Rectangle(1218, 755, 92, 57); Rectangle returnButtonCropArea = new Rectangle(1220, 738, 93, 62);
btnReturn.BackgroundImage = normalStateImage.Clone(returnButtonCropArea, normalStateImage.PixelFormat); //btnReturn.BackgroundImage = normalStateImage.Clone(returnButtonCropArea, normalStateImage.PixelFormat);
btnReturn.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png"));
//btnReturn.BackColor = Color.Transparent;
btnReturn.BackgroundImageLayout = ImageLayout.Stretch; btnReturn.BackgroundImageLayout = ImageLayout.Stretch;
btnReturn.FlatStyle = FlatStyle.Flat; btnReturn.FlatStyle = FlatStyle.Flat;
btnReturn.FlatAppearance.BorderSize = 0; btnReturn.FlatAppearance.BorderSize = 0;
//btnReturn.FlatAppearance.MouseOverBackColor = Color.Transparent;
//btnReturn.FlatAppearance.MouseDownBackColor = Color.Transparent;
btnReturn.Click += ShouYeButton_Click; btnReturn.Click += ShouYeButton_Click;
this.Controls.Add(btnReturn); this.Controls.Add(btnReturn);
Bitmap NPage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png"));
Rectangle nextPageButtonCropArea = new Rectangle(1326, 754, 92, 58); Rectangle nextPageButtonCropArea = new Rectangle(1330, 738, 93, 62);
InitializeButton( InitializeButton(
ref btnNextPage, ref btnNextPage,
"btnNextPage", "btnNextPage",
1326, 754, 92, 58, 1330, 738, 93, 62,
nextPageButtonCropArea, nextPageButtonCropArea,
normalStateImage, NPage,
NextPageButton_Click NextPageButton_Click
); );
Bitmap aPPaulse = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png"));
Rectangle applauseButtonCropArea = new Rectangle(1110, 828, 91, 55); Rectangle applauseButtonCropArea = new Rectangle(1110, 823, 93, 62);
InitializeButton( InitializeButton(
ref btnApplause, ref btnApplause,
"btnApplause", "btnApplause",
1110, 828, 91, 55, 1110, 823, 93, 62,
applauseButtonCropArea, applauseButtonCropArea,
normalStateImage, aPPaulse,
ApplauseButton_Click ApplauseButton_Click
); );
Bitmap SChinese = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png"));
Rectangle simplifiedChineseButtonCropArea = new Rectangle(1327, 828, 90, 55); Rectangle simplifiedChineseButtonCropArea = new Rectangle(1330, 823, 93, 62);
InitializeButton( InitializeButton(
ref btnSimplifiedChinese, ref btnSimplifiedChinese,
"btnSimplifiedChinese", "btnSimplifiedChinese",
1327, 828, 90, 55, 1330, 823, 93, 62,
simplifiedChineseButtonCropArea, simplifiedChineseButtonCropArea,
normalStateImage, SChinese,
SimplifiedChineseButton_Click SimplifiedChineseButton_Click
); );
Bitmap bTChinese = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png"));
Rectangle traditionalChineseButtonCropArea = new Rectangle(1219, 828, 90, 55); Rectangle traditionalChineseButtonCropArea = new Rectangle(1220, 823, 93, 62);
InitializeButton( InitializeButton(
ref btnTraditionalChinese, ref btnTraditionalChinese,
"btnTraditionalChinese", "btnTraditionalChinese",
1219, 828, 90, 55, 1220, 823, 93, 62,
traditionalChineseButtonCropArea, traditionalChineseButtonCropArea,
normalStateImage, bTChinese,
TraditionalChineseButton_Click TraditionalChineseButton_Click
); );
@ -1339,10 +1474,14 @@ namespace DualScreenDemo
{ {
button = new Button { Text = "", Name = buttonName }; button = new Button { Text = "", Name = buttonName };
ResizeAndPositionButton(button, x, y, width, height); ResizeAndPositionButton(button, x, y, width, height);
button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat); //button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
button.BackgroundImage = normalStateImage;
//button.BackColor = Color.Transparent;
button.BackgroundImageLayout = ImageLayout.Stretch; button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat; button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0; button.FlatAppearance.BorderSize = 0;
//button.FlatAppearance.MouseOverBackColor = Color.Transparent;
//button.FlatAppearance.MouseDownBackColor = Color.Transparent;
if (clickEventHandler != null) if (clickEventHandler != null)
{ {
button.Click += clickEventHandler; button.Click += clickEventHandler;
@ -1471,81 +1610,81 @@ namespace DualScreenDemo
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\\555009.jpg")); normalStateImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\0.下方選單_主畫面.jpg"));
resizedNormalStateImage = ResizeImage(normalStateImage, targetWidth, targetHeight); resizedNormalStateImage = ResizeImage(normalStateImage, targetWidth, targetHeight);
mouseOverImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主選單_已按.jpg")); mouseOverImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\0.主選單_已按.jpg"));
resizedMouseOverImage = ResizeImage(mouseOverImage, targetWidth, targetHeight); resizedMouseOverImage = ResizeImage(mouseOverImage, targetWidth, targetHeight);
mouseDownImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主選單_已按.jpg")); mouseDownImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\0.主選單_已按.jpg"));
resizedMouseDownImage = ResizeImage(mouseDownImage, targetWidth, targetHeight); resizedMouseDownImage = ResizeImage(mouseDownImage, targetWidth, targetHeight);
normalStateImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\新歌快報_未按.jpg")); normalStateImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\1.新歌快報_未按.jpg"));
resizedNormalStateImageForNewSongAlert = ResizeImage(normalStateImageNewSongAlert, targetWidth, targetHeight); resizedNormalStateImageForNewSongAlert = ResizeImage(normalStateImageNewSongAlert, targetWidth, targetHeight);
mouseOverImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\新歌快報_已按.jpg")); mouseOverImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg"));
resizedMouseOverImageForNewSongAlert = ResizeImage(mouseOverImageNewSongAlert, targetWidth, targetHeight); resizedMouseOverImageForNewSongAlert = ResizeImage(mouseOverImageNewSongAlert, targetWidth, targetHeight);
mouseDownImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\新歌快報_已按.jpg")); mouseDownImageNewSongAlert = new Bitmap(Path.Combine(Application.StartupPath, "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(Application.StartupPath, "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(Application.StartupPath, "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(Application.StartupPath, "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(Application.StartupPath, "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(Application.StartupPath, "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(Application.StartupPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg"));
resizedMouseDownImageForSongQuery = ResizeImage(mouseDownImageSongQuery, targetWidth, targetHeight); resizedMouseDownImageForSongQuery = ResizeImage(mouseDownImageSongQuery, targetWidth, targetHeight);
normalStateImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\語別查詢_未按.jpg")); normalStateImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\5.語別查詢_未按.jpg"));
resizedNormalStateImageForLanguageQuery = ResizeImage(normalStateImageLanguageQuery, targetWidth, targetHeight); resizedNormalStateImageForLanguageQuery = ResizeImage(normalStateImageLanguageQuery, targetWidth, targetHeight);
mouseOverImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\語別查詢_已按.jpg")); mouseOverImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg"));
resizedMouseOverImageForLanguageQuery = ResizeImage(mouseOverImageLanguageQuery, targetWidth, targetHeight); resizedMouseOverImageForLanguageQuery = ResizeImage(mouseOverImageLanguageQuery, targetWidth, targetHeight);
mouseDownImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\語別查詢_已按.jpg")); mouseDownImageLanguageQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg"));
resizedMouseDownImageForLanguageQuery = ResizeImage(mouseDownImageLanguageQuery, targetWidth, targetHeight); resizedMouseDownImageForLanguageQuery = ResizeImage(mouseDownImageLanguageQuery, targetWidth, targetHeight);
normalStateImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\類別查詢_未按.jpg")); normalStateImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\7.類別查詢_未按.jpg"));
resizedNormalStateImageForCategoryQuery = ResizeImage(normalStateImageCategoryQuery, targetWidth, targetHeight); resizedNormalStateImageForCategoryQuery = ResizeImage(normalStateImageCategoryQuery, targetWidth, targetHeight);
mouseOverImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\類別查詢_已按.jpg")); mouseOverImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg"));
resizedMouseOverImageForCategoryQuery = ResizeImage(mouseOverImageCategoryQuery, targetWidth, targetHeight); resizedMouseOverImageForCategoryQuery = ResizeImage(mouseOverImageCategoryQuery, targetWidth, targetHeight);
mouseDownImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\類別查詢_已按.jpg")); mouseDownImageCategoryQuery = new Bitmap(Path.Combine(Application.StartupPath, "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(Application.StartupPath, "themes\\superstar\\主畫面\\555021.jpg"));
resizedNormalStateImageForPromotionsAndMenu = ResizeImage(normalStateImageForPromotionsAndMenu, targetWidth, targetHeight); resizedNormalStateImageForPromotionsAndMenu = ResizeImage(normalStateImageForPromotionsAndMenu, targetWidth, targetHeight);
try try
{ {
string imagePath = Path.Combine(Application.StartupPath, "themes\\superstar\\555019.jpg"); string imagePath = Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\選單內介面_同步畫面.jpg");
if (File.Exists(imagePath)) if (File.Exists(imagePath))
{ {
@ -1565,17 +1704,17 @@ namespace DualScreenDemo
} }
normalStateImageForSceneSoundEffects = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\555022.jpg")); normalStateImageForSceneSoundEffects = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\555022.jpg"));
resizedNormalStateImageForSceneSoundEffects = ResizeImage(normalStateImageForSceneSoundEffects, targetWidth, targetHeight); resizedNormalStateImageForSceneSoundEffects = ResizeImage(normalStateImageForSceneSoundEffects, targetWidth, targetHeight);
normalStateImageHotSong = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\熱門排行_未按.jpg")); normalStateImageHotSong = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\2.熱門排行_未按.jpg"));
resizedNormalStateImageForHotSong = ResizeImage(normalStateImageHotSong, targetWidth, targetHeight); resizedNormalStateImageForHotSong = ResizeImage(normalStateImageHotSong, targetWidth, targetHeight);
mouseDownImageHotSong = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\熱門排行_已按.jpg")); mouseDownImageHotSong = new Bitmap(Path.Combine(Application.StartupPath, "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(Application.StartupPath, "themes\\superstar\\主畫面\\選單內介面_燈光控制.jpg"));
resizedNormalStateImageForLightControl = ResizeImage(normalStateImageForLightControl, targetWidth, targetHeight); resizedNormalStateImageForLightControl = ResizeImage(normalStateImageForLightControl, targetWidth, targetHeight);
} }
@ -1718,7 +1857,7 @@ namespace DualScreenDemo
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground; orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground; promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodActiveBackground; deliciousFoodButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_美味菜單(已按).png"));
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);
@ -2151,8 +2290,10 @@ namespace DualScreenDemo
buttonThanks.Size = new Size((int)(150 * scaleX), (int)(150 * scaleY)); buttonThanks.Size = new Size((int)(150 * scaleX), (int)(150 * scaleY));
// ========== 服務鈴位置與大小 ========== // ========== 服務鈴位置與大小 ==========
serviceBellPictureBox.Location = new Point((int)(757 * scaleX), (int)(151 * scaleY)); //serviceBellPictureBox.Location = new Point((int)(757 * scaleX), (int)(151 * scaleY));
serviceBellPictureBox.Size = new Size((int)(410 * scaleX), (int)(130 * scaleY)); serviceBellPictureBox.Location = new Point(740,103);
//serviceBellPictureBox.Size = new Size((int)(410 * scaleX), (int)(130 * scaleY));
serviceBellPictureBox.Size = new Size(430,146);
} }
/// <summary> /// <summary>
@ -2210,14 +2351,14 @@ namespace DualScreenDemo
{ {
try try
{ {
string filePath = Path.Combine(Application.StartupPath, "themes\\superstar\\VOD_送客畫面.jpg"); string filePath = Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\選單內介面_送客畫面.jpg");
if (File.Exists(filePath)) if (File.Exists(filePath))
{ {
return Image.FromFile(filePath); return Image.FromFile(filePath);
} }
else else
{ {
Console.WriteLine("VOD_送客畫面.jpg 文件未找到。"); Console.WriteLine("選單內介面_送客畫面.jpg 文件未找到。");
return null; return null;
} }
} }
@ -2260,7 +2401,7 @@ namespace DualScreenDemo
languageSearchButton.BackgroundImage = languageSearchNormalBackground; languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground; groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsActiveBackground; orderedSongsButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_已點歌曲(已按).png"));
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground; promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground; deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
@ -2296,5 +2437,33 @@ namespace DualScreenDemo
multiPagePanel.LoadPlayedSongs(List); multiPagePanel.LoadPlayedSongs(List);
} }
private void SetUIVisible(Control parent)
{
foreach (Control ctrl in parent.Controls)
{
parent.Visible = true;
parent.BringToFront();
ctrl.Visible = true;
ctrl.BringToFront();
if (ctrl.HasChildren)
{
SetUIVisible(ctrl);
}
}
}
private void CloseUI(Control parent)
{
foreach (Control ctrl in parent.Controls)
{
parent.Visible = false;
ctrl.Visible = false;
if (ctrl.HasChildren)
{
CloseUI(ctrl);
}
}
}
} }
} }

View File

@ -8,6 +8,8 @@ namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private TableLayoutPanel BopomofoSearch;
private PictureBox pictureBoxZhuYinSingers; private PictureBox pictureBoxZhuYinSingers;
private Button[] phoneticButtonsForSingers; private Button[] phoneticButtonsForSingers;
@ -71,6 +73,7 @@ namespace DualScreenDemo
} }
/// <summary> /// <summary>
/// <para>從 config.ini 設定檔中載入注音符號Phonetic Symbols。</para> /// <para>從 config.ini 設定檔中載入注音符號Phonetic Symbols。</para>
/// <para>讀取 ini 檔的 [PhoneticSymbols] 區塊並將「Symbols」欄位的值解析為陣列。</para> /// <para>讀取 ini 檔的 [PhoneticSymbols] 區塊並將「Symbols」欄位的值解析為陣列。</para>
@ -524,7 +527,7 @@ namespace DualScreenDemo
private void FindZhuYiSingers(){ private void FindZhuYiSingers(){
string searchText = inputBoxZhuYinSingers.Text; string searchText = inputBoxZhuYinSingers.Text;
string query = string.IsNullOrWhiteSpace(searchText) string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM artists LIMIT 50;" ? "SELECT * FROM artists LIMIT 1000;"
: $"SELECT * FROM artists WHERE `phonetic_abbr` LIKE '{searchText}%';"; : $"SELECT * FROM artists WHERE `phonetic_abbr` LIKE '{searchText}%';";
//string query = $"SELECT * FROM ArtistLibrary WHERE `歌手注音` LIKE '{searchText}%' "; //string query = $"SELECT * FROM ArtistLibrary WHERE `歌手注音` LIKE '{searchText}%' ";
var searchResults = SearchSingers_Mysql(query); var searchResults = SearchSingers_Mysql(query);

View File

@ -274,7 +274,7 @@ namespace DualScreenDemo
private void FindEnglishSingers(){ private void FindEnglishSingers(){
string searchText = inputBoxEnglishSingers.Text; string searchText = inputBoxEnglishSingers.Text;
string query = string.IsNullOrWhiteSpace(searchText) string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM artists LIMIT 50;" ? "SELECT * FROM artists LIMIT 1000;"
: $"SELECT * FROM artists WHERE `name` LIKE '%{searchText}%';"; : $"SELECT * FROM artists WHERE `name` LIKE '%{searchText}%';";
//string query = $"SELECT * FROM ArtistLibrary WHERE `歌手姓名` LIKE '{searchText}%' "; //string query = $"SELECT * FROM ArtistLibrary WHERE `歌手姓名` LIKE '{searchText}%' ";
var searchResults = SearchSingers_Mysql(query); var searchResults = SearchSingers_Mysql(query);

View File

@ -129,7 +129,7 @@ namespace DualScreenDemo
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular), Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
Visible = false Visible = false
}; };
ResizeAndPositionControl(candidateListBoxForSingers, 350 + 679, 448, 115, 260); ResizeAndPositionControl(candidateListBoxForSingers, 347 + 679, 448, 115, 270);
candidateListBoxForSingers.SelectedIndexChanged += CandidateListBoxForSingers_SelectedIndexChanged; candidateListBoxForSingers.SelectedIndexChanged += CandidateListBoxForSingers_SelectedIndexChanged;
this.Controls.Add(candidateListBoxForSingers); this.Controls.Add(candidateListBoxForSingers);
} }
@ -290,7 +290,7 @@ namespace DualScreenDemo
private void FindHandwritingSingers(){ private void FindHandwritingSingers(){
string searchText = handwritingInputBoxForSingers.Text; string searchText = handwritingInputBoxForSingers.Text;
string query = string.IsNullOrWhiteSpace(searchText) string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM artists LIMIT 50;" ? "SELECT * FROM artists LIMIT 1000;"
: $"SELECT * FROM artists WHERE `name` LIKE '{searchText}%';"; : $"SELECT * FROM artists WHERE `name` LIKE '{searchText}%';";
//string query = $"SELECT * FROM ArtistLibrary WHERE `歌手姓名` LIKE '{searchText}%' "; //string query = $"SELECT * FROM ArtistLibrary WHERE `歌手姓名` LIKE '{searchText}%' ";
var searchResults = SearchSingers_Mysql(query); var searchResults = SearchSingers_Mysql(query);

View File

@ -176,7 +176,7 @@ namespace DualScreenDemo
// 在這裡添加搜尋歌曲的邏輯 // 在這裡添加搜尋歌曲的邏輯
// 例如:根據輸入框的內容搜尋歌曲 // 例如:根據輸入框的內容搜尋歌曲
string query = string.IsNullOrWhiteSpace(searchText) string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM artists; LIMIT 50" ? "SELECT * FROM artists; LIMIT 1000"
: $"SELECT * FROM artists WHERE `pinyin_abbr` LIKE '{searchText}%';"; : $"SELECT * FROM artists WHERE `pinyin_abbr` LIKE '{searchText}%';";
//string query = $"SELECT * FROM SongLibrary WHERE `歌星A拼音` LIKE '{searchText}%' OR `歌星B拼音` LIKE '{searchText}%' "; //string query = $"SELECT * FROM SongLibrary WHERE `歌星A拼音` LIKE '{searchText}%' OR `歌星B拼音` LIKE '{searchText}%' ";

View File

@ -34,6 +34,7 @@ namespace DualScreenDemo
private Button modifyButtonWordCountSingers; private Button modifyButtonWordCountSingers;
private Button clearButtonWordCountSingers; private Button clearButtonWordCountSingers;
private Button closeButtonWordCountSingers; private Button closeButtonWordCountSingers;
private Button enterButtonWordCountSingers;
private string[] numberWordCountSymbols; private string[] numberWordCountSymbols;
private (int X, int Y, int Width, int Height)[] numberWordCountButtonCoords; private (int X, int Y, int Width, int Height)[] numberWordCountButtonCoords;
@ -42,6 +43,7 @@ namespace DualScreenDemo
private (int X, int Y, int Width, int Height) modifyButtonWordCountCoords; private (int X, int Y, int Width, int Height) modifyButtonWordCountCoords;
private (int X, int Y, int Width, int Height) clearButtonWordCountCoords; private (int X, int Y, int Width, int Height) clearButtonWordCountCoords;
private (int X, int Y, int Width, int Height) closeButtonWordCountCoords; private (int X, int Y, int Width, int Height) closeButtonWordCountCoords;
private (int X, int Y, int Width, int Height) enterButtonWordCountCoords;
private RichTextBox inputBoxWordCountSingers; private RichTextBox inputBoxWordCountSingers;
@ -414,6 +416,9 @@ namespace DualScreenDemo
// 初始化關閉按鈕 // 初始化關閉按鈕
InitializeCloseButtonWordCountSingers(); InitializeCloseButtonWordCountSingers();
// 初始化enter按鈕
InitializeEnterButtonWordCountSingers();
} }
@ -522,6 +527,27 @@ namespace DualScreenDemo
); );
} }
private void InitializeEnterButtonWordCountSingers()
{
// 加載配置數據
var data = LoadConfigDataforWordCountSingers();
// 讀取按鈕坐標
enterButtonWordCountCoords = LoadSpecialButtonCoordinatesForWordCountSingers(data, "SpecialButtonCoordinates", "enterButtonWordCountSingers");
// 加載按鈕圖片(正常、鼠標懸停、鼠標按下)
var buttonImages = LoadButtonImagesForWordCountSingers(data, "EnterButtonImagesWordCount");
// 創建「修改」按鈕,並設置坐標、圖片及點擊事件
enterButtonWordCountSingers = CreateSpecialButtonForWordCountSingers(
"btnEnterWordCountSingers", // 按鈕名稱
enterButtonWordCountCoords, // 按鈕坐標
buttonImages.normal, // 正常狀態圖片
buttonImages.mouseOver, // 鼠標懸停圖片
buttonImages.mouseDown, // 鼠標按下圖片
(sender, e) => FindWordCountSingers() // 按鈕點擊事件
);
}
/// <summary> /// <summary>
/// 「關閉」按鈕的點擊事件處理方法。 /// 「關閉」按鈕的點擊事件處理方法。
@ -534,10 +560,11 @@ namespace DualScreenDemo
// 隱藏 WordCount 歌手圖片框 // 隱藏 WordCount 歌手圖片框
pictureBoxWordCountSingers.Visible = false; pictureBoxWordCountSingers.Visible = false;
wordCountSearchButton.BackgroundImage = wordCountSearchNormalBackground; wordCountSearchButton.BackgroundImage = wordCountSearchNormalBackground;
FindWordCountSingers();
// 隱藏與 WordCount 歌手相關的所有按鈕 // 隱藏與 WordCount 歌手相關的所有按鈕
SetWordCountSingersAndButtonsVisibility(false); SetWordCountSingersAndButtonsVisibility(false);
} }
private void FindWordCountSingers(){ private void FindWordCountSingers(){
string searchText = inputBoxWordCountSingers.Text; // 取得輸入內容 string searchText = inputBoxWordCountSingers.Text; // 取得輸入內容
if (int.TryParse(searchText, out int length)) if (int.TryParse(searchText, out int length))
@ -814,6 +841,17 @@ namespace DualScreenDemo
if (isVisible) inputBoxWordCountSingers.BringToFront(); // 如果顯示,將其置於最前 if (isVisible) inputBoxWordCountSingers.BringToFront(); // 如果顯示,將其置於最前
} }
// 檢查並設置enter按鈕的可見性
if (enterButtonWordCountSingers == null)
{
Console.WriteLine("enterButtonWordCountSingers is null");
}
else
{
enterButtonWordCountSingers.Visible = isVisible;
if (isVisible) enterButtonWordCountSingers.BringToFront(); // 如果顯示,將其置於最前
}
// 恢復控制項的佈局重新排版 // 恢復控制項的佈局重新排版
ResumeLayout(); ResumeLayout();
PerformLayout(); PerformLayout();
@ -830,6 +868,7 @@ namespace DualScreenDemo
modifyButtonWordCountSingers?.Refresh(); modifyButtonWordCountSingers?.Refresh();
clearButtonWordCountSingers?.Refresh(); clearButtonWordCountSingers?.Refresh();
closeButtonWordCountSingers?.Refresh(); closeButtonWordCountSingers?.Refresh();
enterButtonWordCountSingers?.Refresh();
inputBoxWordCountSingers?.Refresh(); inputBoxWordCountSingers?.Refresh();
} }
catch (Exception ex) catch (Exception ex)

View File

@ -1,31 +1,34 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private Button zhuyinSearchButton; private Button zhuyinSearchButton;
private Bitmap zhuyinSearchNormalBackground; private Bitmap zhuyinSearchNormalBackground =new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_注音查詢(未按).png"));
private Bitmap zhuyinSearchActiveBackground; private Bitmap zhuyinSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_注音查詢(已按).png"));
private Button englishSearchButton; private Button englishSearchButton;
private Bitmap englishSearchNormalBackground; private Bitmap englishSearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_英文查詢(未按).png"));
private Bitmap englishSearchActiveBackground; private Bitmap englishSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_英文查詢(已按).png"));
private Button pinyinSearchButton; private Button pinyinSearchButton;
private Bitmap pinyinSearchNormalBackground; private Bitmap pinyinSearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_拼音查詢(未按).png"));
private Bitmap pinyinSearchActiveBackground; private Bitmap pinyinSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_拼音查詢(已按).png"));
private Button wordCountSearchButton; private Button wordCountSearchButton;
private Bitmap wordCountSearchNormalBackground; private Bitmap wordCountSearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_字數查詢(未按).png"));
private Bitmap wordCountSearchActiveBackground; private Bitmap wordCountSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_字數查詢(已按).png"));
private Button handWritingSearchButton; private Button handWritingSearchButton;
private Bitmap handWritingSearchNormalBackground; private Bitmap handWritingSearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_手寫查詢(未按).png"));
private Bitmap handWritingSearchActiveBackground; private Bitmap handWritingSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_手寫查詢(已按).png"));
private void SingerSearchButton_Click(object sender, EventArgs e) private void SingerSearchButton_Click(object sender, EventArgs e)
{ {
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground; newSongAlertButton.BackgroundImage = newSongAlertNormalBackground;
hotPlayButton.BackgroundImage = hotPlayNormalBackground; hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchActiveBackground; //singerSearchButton.BackgroundImage = singerSearchActiveBackground;
singerSearchButton.BackgroundImage =new Bitmap (Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_歌星查詢(已按).png")); ;
songSearchButton.BackgroundImage = songSearchNormalBackground; songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchNormalBackground; languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground; groupSearchButton.BackgroundImage = groupSearchNormalBackground;
@ -37,7 +40,7 @@ namespace DualScreenDemo
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
/* 清空搜尋欄 */ /* 清空搜尋欄 */
ResetinputBox(); ResetinputBox();
string query = $"SELECT * FROM artists WHERE category = '男' LIMIT 100 ;"; string query = $"SELECT * FROM artists WHERE category = '男' LIMIT 1000 ;";
var searchResult = SearchSingers_Mysql(query); var searchResult = SearchSingers_Mysql(query);
currentPage = 0; currentPage = 0;
currentArtistList = searchResult; currentArtistList = searchResult;
@ -88,17 +91,17 @@ namespace DualScreenDemo
private void InitializeButtonsForSingerSearch() private void InitializeButtonsForSingerSearch()
{ {
InitializeSearchButton(ref zhuyinSearchButton, "zhuyinSearchButton", 1214, 230, 209, 59, ref zhuyinSearchNormalBackground, ref zhuyinSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, ZhuyinSearchSingersButton_Click); InitializeSearchButton(ref zhuyinSearchButton, "zhuyinSearchButton", 1197, 225, 225, 50, ref zhuyinSearchNormalBackground, ref zhuyinSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, ZhuyinSearchSingersButton_Click);
InitializeSearchButton(ref englishSearchButton, "englishSearchButton", 1214, 293, 209, 58, ref englishSearchNormalBackground, ref englishSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, EnglishSearchSingersButton_Click); InitializeSearchButton(ref englishSearchButton, "englishSearchButton", 1197, 280, 225, 50, ref englishSearchNormalBackground, ref englishSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, EnglishSearchSingersButton_Click);
InitializeSearchButton(ref pinyinSearchButton, "pinyinSearchButton", 1214, 356, 209, 58, ref pinyinSearchNormalBackground, ref pinyinSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, PinyinSingerSearchButton_Click); InitializeSearchButton(ref pinyinSearchButton, "pinyinSearchButton", 1197, 335, 225, 50, ref pinyinSearchNormalBackground, ref pinyinSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, PinyinSingerSearchButton_Click);
InitializeSearchButton(ref wordCountSearchButton, "workCountSearchButton", 1214, 418, 209, 59, ref wordCountSearchNormalBackground, ref wordCountSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, WordCountSearchSingersButton_Click); InitializeSearchButton(ref wordCountSearchButton, "workCountSearchButton", 1197, 390, 225, 50, ref wordCountSearchNormalBackground, ref wordCountSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, WordCountSearchSingersButton_Click);
InitializeSearchButton(ref handWritingSearchButton, "handWritingSearchButton", 1214, 481, 209, 59, ref handWritingSearchNormalBackground, ref handWritingSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, HandWritingSearchButtonForSingers_Click); InitializeSearchButton(ref handWritingSearchButton, "handWritingSearchButton", 1197, 445, 225, 50, ref handWritingSearchNormalBackground, ref handWritingSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, HandWritingSearchButtonForSingers_Click);
} }
private void InitializeSearchButton(ref Button button, string name, int x, int y, int width, int height, ref Bitmap normalBackground, ref Bitmap activeBackground, Bitmap normalImage, Bitmap activeImage, EventHandler clickEventHandler) private void InitializeSearchButton(ref Button button, string name, int x, int y, int width, int height, ref Bitmap normalBackground, ref Bitmap activeBackground, Bitmap normalImage, Bitmap activeImage, EventHandler clickEventHandler)
@ -106,8 +109,8 @@ namespace DualScreenDemo
button = new Button { Text = "", Visible = true, Name = name }; button = new Button { Text = "", Visible = true, Name = name };
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 = normalImage.Clone(buttonCropArea, normalImage.PixelFormat); //normalBackground = normalImage.Clone(buttonCropArea, normalImage.PixelFormat);
activeBackground = activeImage.Clone(buttonCropArea, activeImage.PixelFormat); //activeBackground = activeImage.Clone(buttonCropArea, activeImage.PixelFormat);
button.BackgroundImage = normalBackground; button.BackgroundImage = normalBackground;
button.BackgroundImageLayout = ImageLayout.Stretch; button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat; button.FlatStyle = FlatStyle.Flat;

View File

@ -311,7 +311,7 @@ namespace DualScreenDemo
// 例如:根據輸入框的內容搜尋歌曲 // 例如:根據輸入框的內容搜尋歌曲
string query = string.IsNullOrWhiteSpace(searchText) string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM song_library_cache ORDER BY `song_id` DESC LIMIT 200;" ? "SELECT * FROM song_library_cache ORDER BY `song_id` DESC LIMIT 1000;"
: $"SELECT * FROM song_library_cache WHERE `phonetic_abbr` LIKE '{searchText}%' ORDER BY `song_id`;"; : $"SELECT * FROM song_library_cache WHERE `phonetic_abbr` LIKE '{searchText}%' ORDER BY `song_id`;";
var searchResults = SearchSongs_Mysql(query); var searchResults = SearchSongs_Mysql(query);

View File

@ -230,7 +230,7 @@ namespace DualScreenDemo
string searchText = inputBoxEnglishSongs.Text; string searchText = inputBoxEnglishSongs.Text;
// 檢查是否為空字串或空白字元 // 檢查是否為空字串或空白字元
string query = string.IsNullOrWhiteSpace(searchText) string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 200;" ? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 1000;"
: $"SELECT * FROM song_library_cache WHERE song_name LIKE '{searchText}%' ORDER BY song_id DESC;"; : $"SELECT * FROM song_library_cache WHERE song_name LIKE '{searchText}%' ORDER BY song_id DESC;";
var searchResults = SearchSongs_Mysql(query); var searchResults = SearchSongs_Mysql(query);

View File

@ -126,7 +126,7 @@ namespace DualScreenDemo
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular), Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
Visible = false Visible = false
}; };
ResizeAndPositionControl(candidateListBoxForSongs, 350 + 679, 448, 115, 260); ResizeAndPositionControl(candidateListBoxForSongs, 347 + 679, 448, 115, 270);
candidateListBoxForSongs.SelectedIndexChanged += CandidateListBoxForSongs_SelectedIndexChanged; candidateListBoxForSongs.SelectedIndexChanged += CandidateListBoxForSongs_SelectedIndexChanged;
this.Controls.Add(candidateListBoxForSongs); this.Controls.Add(candidateListBoxForSongs);
} }
@ -287,7 +287,7 @@ namespace DualScreenDemo
// 在這裡添加搜尋歌曲的邏輯 // 在這裡添加搜尋歌曲的邏輯
// 例如:根據輸入框的內容搜尋歌曲 // 例如:根據輸入框的內容搜尋歌曲
string query = string.IsNullOrWhiteSpace(searchText) string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 200;" ? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 1000;"
: $"SELECT * FROM song_library_cache WHERE song_name LIKE '{searchText}%' ORDER BY song_id DESC;"; : $"SELECT * FROM song_library_cache WHERE song_name LIKE '{searchText}%' ORDER BY song_id DESC;";

View File

@ -35,6 +35,7 @@ namespace DualScreenDemo
private Button modifyButtonSongIDSearch; private Button modifyButtonSongIDSearch;
private Button clearButtonSongIDSearch; private Button clearButtonSongIDSearch;
private Button closeButtonSongIDSearch; private Button closeButtonSongIDSearch;
private Button enterButtonSongIDSearch;
private string[] numberSongIDSymbols; private string[] numberSongIDSymbols;
private (int X, int Y, int Width, int Height)[] numberSongIDButtonCoords; private (int X, int Y, int Width, int Height)[] numberSongIDButtonCoords;
@ -43,6 +44,7 @@ namespace DualScreenDemo
private (int X, int Y, int Width, int Height) modifyButtonSongIDCoords; private (int X, int Y, int Width, int Height) modifyButtonSongIDCoords;
private (int X, int Y, int Width, int Height) clearButtonSongIDCoords; private (int X, int Y, int Width, int Height) clearButtonSongIDCoords;
private (int X, int Y, int Width, int Height) closeButtonSongIDCoords; private (int X, int Y, int Width, int Height) closeButtonSongIDCoords;
private (int X, int Y, int Width, int Height) enterButtonSongIDCoords;
private RichTextBox inputBoxSongIDSearch; private RichTextBox inputBoxSongIDSearch;
@ -492,15 +494,15 @@ namespace DualScreenDemo
var data = LoadConfigDataforSongIDSearch(); var data = LoadConfigDataforSongIDSearch();
// 讀取按鈕坐標 // 讀取按鈕坐標
clearButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "enterButtonSongIDSearch"); enterButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "enterButtonSongIDSearch");
// 加載按鈕圖片(正常、鼠標懸停、鼠標按下) // 加載按鈕圖片(正常、鼠標懸停、鼠標按下)
var buttonImages = LoadButtonImagesForSongIDSearch(data, "EnterButtonImagesSongID"); var buttonImages = LoadButtonImagesForSongIDSearch(data, "EnterButtonImagesSongID");
// 創建「清除」按鈕,並設置坐標、圖片及點擊事件 // 創建「清除」按鈕,並設置坐標、圖片及點擊事件
clearButtonSongIDSearch = CreateSpecialButtonForSongIDSearch( enterButtonSongIDSearch = CreateSpecialButtonForSongIDSearch(
"btnEnterSongIDSearch", // 按鈕名稱 "btnEnterSongIDSearch", // 按鈕名稱
clearButtonSongIDCoords, // 按鈕坐標 enterButtonSongIDCoords, // 按鈕坐標
buttonImages.normal, // 正常狀態圖片 buttonImages.normal, // 正常狀態圖片
buttonImages.mouseOver, // 鼠標懸停圖片 buttonImages.mouseOver, // 鼠標懸停圖片
buttonImages.mouseDown, // 鼠標按下圖片 buttonImages.mouseDown, // 鼠標按下圖片
@ -565,6 +567,7 @@ namespace DualScreenDemo
modifyButtonSongIDSearch.Visible = false; modifyButtonSongIDSearch.Visible = false;
clearButtonSongIDSearch.Visible = false; clearButtonSongIDSearch.Visible = false;
closeButtonSongIDSearch.Visible = false; closeButtonSongIDSearch.Visible = false;
enterButtonSongIDSearch.Visible = false;
inputBoxSongIDSearch.Visible = false; inputBoxSongIDSearch.Visible = false;
for(int i=0; i <= 9; i++) for(int i=0; i <= 9; i++)
{ {
@ -857,6 +860,17 @@ namespace DualScreenDemo
if (isVisible) closeButtonSongIDSearch.BringToFront(); // 如果顯示,將其置於最前 if (isVisible) closeButtonSongIDSearch.BringToFront(); // 如果顯示,將其置於最前
} }
// 檢查並設置關閉按鈕的可見性
if (enterButtonSongIDSearch == null)
{
Console.WriteLine("enterButtonSongIDSearch is null");
}
else
{
enterButtonSongIDSearch.Visible = isVisible;
if (isVisible) enterButtonSongIDSearch.BringToFront(); // 如果顯示,將其置於最前
}
// 檢查並設置輸入框的可見性 // 檢查並設置輸入框的可見性
if (inputBoxSongIDSearch == null) if (inputBoxSongIDSearch == null)
{ {

View File

@ -266,7 +266,7 @@ namespace DualScreenDemo
// 在這裡添加搜尋歌曲的邏輯 // 在這裡添加搜尋歌曲的邏輯
// 例如:根據輸入框的內容搜尋歌曲 // 例如:根據輸入框的內容搜尋歌曲
string query = string.IsNullOrWhiteSpace(searchText) string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 200;" ? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 1000;"
: $"SELECT * FROM song_library_cache WHERE pinyin_abbr LIKE '{searchText}%' ORDER BY `song_id` DESC;"; : $"SELECT * FROM song_library_cache WHERE pinyin_abbr LIKE '{searchText}%' ORDER BY `song_id` DESC;";
var searchResults = SearchSongs_Mysql(query); var searchResults = SearchSongs_Mysql(query);
// 重置分頁 // 重置分頁

View File

@ -14,7 +14,7 @@ namespace DualScreenDemo
private Button modifyButtonWordCountSongs; private Button modifyButtonWordCountSongs;
private Button clearButtonWordCountSongs; private Button clearButtonWordCountSongs;
private Button closeButtonWordCountSongs; private Button closeButtonWordCountSongs;
private Button enterButtonWordCountSongs;
private RichTextBox inputBoxWordCountSongs; private RichTextBox inputBoxWordCountSongs;
@ -342,6 +342,9 @@ namespace DualScreenDemo
// 初始化關閉按鈕 // 初始化關閉按鈕
InitializeCloseButtonWordCountSongs(); InitializeCloseButtonWordCountSongs();
// 初始化確認按鈕
InitializeEnterButtonWordCountSongs();
} }
@ -451,6 +454,28 @@ namespace DualScreenDemo
} }
private void InitializeEnterButtonWordCountSongs()
{
// 加載配置數據
var data = LoadConfigDataforWordCountSongs();
// 讀取按鈕坐標
enterButtonWordCountCoords = LoadSpecialButtonCoordinatesForWordCountSongs(data, "SpecialButtonCoordinates", "enterButtonWordCountSongs");
// 加載按鈕圖片(正常、鼠標懸停、鼠標按下)
var buttonImages = LoadButtonImagesForWordCountSongs(data, "EnterButtonImagesWordCount");
// 創建「關閉」按鈕,並設置坐標、圖片及點擊事件
enterButtonWordCountSongs = CreateSpecialButtonForWordCountSongs(
"btnEnterWordCountSongs", // 按鈕名稱
enterButtonWordCountCoords, // 按鈕坐標
buttonImages.normal, // 正常狀態圖片
buttonImages.mouseOver, // 鼠標懸停圖片
buttonImages.mouseDown, // 鼠標按下圖片
EnterButtonWordCountSongs_Click // 按鈕點擊事件
);
}
/// <summary> /// <summary>
/// 「關閉」按鈕的點擊事件處理方法。 /// 「關閉」按鈕的點擊事件處理方法。
/// 隱藏 WordCount 歌手圖片框以及與其相關的按鈕。 /// 隱藏 WordCount 歌手圖片框以及與其相關的按鈕。
@ -466,8 +491,14 @@ namespace DualScreenDemo
// 隱藏與 WordCount 歌手相關的所有按鈕 // 隱藏與 WordCount 歌手相關的所有按鈕
SetWordCountSongsAndButtonsVisibility(false); SetWordCountSongsAndButtonsVisibility(false);
// 歌曲查詢改版 // 歌曲查詢改版
}
private void EnterButtonWordCountSongs_Click(object sender, EventArgs e)
{
// 歌曲查詢改版
FindWordCountSongs(); FindWordCountSongs();
} }
/// <summary> /// <summary>
/// 查詢歌曲(字數查詢),連接資料庫並執行 SQL 查詢。 /// 查詢歌曲(字數查詢),連接資料庫並執行 SQL 查詢。
/// </summary> /// </summary>
@ -756,6 +787,16 @@ namespace DualScreenDemo
if (isVisible) inputBoxWordCountSongs.BringToFront(); // 如果顯示,將其置於最前 if (isVisible) inputBoxWordCountSongs.BringToFront(); // 如果顯示,將其置於最前
} }
if (enterButtonWordCountSongs == null)
{
Console.WriteLine("enterButtonWordCountSongs is null");
}
else
{
enterButtonWordCountSongs.Visible = isVisible;
if (isVisible) enterButtonWordCountSongs.BringToFront(); // 如果顯示,將其置於最前
}
// 恢復控制項的佈局重新排版 // 恢復控制項的佈局重新排版
ResumeLayout(); ResumeLayout();
PerformLayout(); PerformLayout();
@ -772,6 +813,7 @@ namespace DualScreenDemo
modifyButtonWordCountSongs?.Refresh(); modifyButtonWordCountSongs?.Refresh();
clearButtonWordCountSongs?.Refresh(); clearButtonWordCountSongs?.Refresh();
closeButtonWordCountSongs?.Refresh(); closeButtonWordCountSongs?.Refresh();
enterButtonWordCountSongs?.Refresh();
inputBoxWordCountSongs?.Refresh(); inputBoxWordCountSongs?.Refresh();
} }
catch (Exception ex) catch (Exception ex)

View File

@ -1,3 +1,5 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
/* /*
@ -8,23 +10,23 @@ namespace DualScreenDemo
{ {
// 各種歌曲搜尋按鈕及其對應的背景圖片 (一般狀態 / 啟動狀態) // 各種歌曲搜尋按鈕及其對應的背景圖片 (一般狀態 / 啟動狀態)
private Button zhuyinSearchSongButton; private Button zhuyinSearchSongButton;
private Bitmap zhuyinSearchSongNormalBackground; private Bitmap zhuyinSearchSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_注音查詢(未按).png"));
private Bitmap zhuyinSearchSongActiveBackground; private Bitmap zhuyinSearchSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_注音查詢(已按).png"));
private Button englishSearchSongButton; private Button englishSearchSongButton;
private Bitmap englishSearchSongNormalBackground; private Bitmap englishSearchSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_英文查詢(未按).png"));
private Bitmap englishSearchSongActiveBackground; private Bitmap englishSearchSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_英文查詢(已按).png"));
private Button wordCountSearchSongButton; private Button wordCountSearchSongButton;
private Bitmap wordCountSearchSongNormalBackground; private Bitmap wordCountSearchSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_字數查詢(未按).png"));
private Bitmap wordCountSearchSongActiveBackground; private Bitmap wordCountSearchSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_字數查詢(已按).png"));
private Button pinyinSearchSongButton; private Button pinyinSearchSongButton;
private Bitmap pinyinSearchSongNormalBackground; private Bitmap pinyinSearchSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_拼音查詢(未按).png"));
private Bitmap pinyinSearchSongActiveBackground; private Bitmap pinyinSearchSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_拼音查詢(已按).png"));
private Button handWritingSearchSongButton; private Button handWritingSearchSongButton;
private Bitmap handWritingSearchSongNormalBackground; private Bitmap handWritingSearchSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_手寫查詢(未按).png"));
private Bitmap handWritingSearchSongActiveBackground; private Bitmap handWritingSearchSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_手寫查詢(已按).png"));
private Button numberSearchSongButton; private Button numberSearchSongButton;
private Bitmap numberSearchSongNormalBackground; private Bitmap numberSearchSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_編號查詢(未按).png"));
private Bitmap numberSearchSongActiveBackground; private Bitmap numberSearchSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_編號查詢(已按).png"));
/// <summary> /// <summary>
/// 點擊「歌曲搜尋」按鈕時的事件處理函式 /// 點擊「歌曲搜尋」按鈕時的事件處理函式
@ -39,6 +41,7 @@ namespace DualScreenDemo
hotPlayButton.BackgroundImage = hotPlayNormalBackground; hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground; singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchActiveBackground; songSearchButton.BackgroundImage = songSearchActiveBackground;
songSearchButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_歌名查詢(已按).png"));
languageSearchButton.BackgroundImage = languageSearchNormalBackground; languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground; groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground; categorySearchButton.BackgroundImage = categorySearchNormalBackground;
@ -49,7 +52,7 @@ namespace DualScreenDemo
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
ResetinputBox(); ResetinputBox();
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' LIMIT 100;"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' LIMIT 1000;";
var searchResult = SearchSongs_Mysql(query); var searchResult = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
totalPages = (int)Math.Ceiling((double)searchResult.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)searchResult.Count / itemsPerPage);
@ -121,32 +124,32 @@ namespace DualScreenDemo
{ {
// 初始化「注音搜尋」按鈕 // 初始化「注音搜尋」按鈕
InitializeSearchButton(ref zhuyinSearchSongButton, "zhuyinSearchSongButton", InitializeSearchButton(ref zhuyinSearchSongButton, "zhuyinSearchSongButton",
1214, 230, 209, 59, ref zhuyinSearchSongNormalBackground, ref zhuyinSearchSongActiveBackground, 1197, 225, 225, 50, ref zhuyinSearchSongNormalBackground, ref zhuyinSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, ZhuyinSearchSongsButton_Click); normalStateImageSongQuery, mouseDownImageSongQuery, ZhuyinSearchSongsButton_Click);
// 初始化「英文搜尋」按鈕 // 初始化「英文搜尋」按鈕
InitializeSearchButton(ref englishSearchSongButton, "englishSearchSongButton", InitializeSearchButton(ref englishSearchSongButton, "englishSearchSongButton",
1214, 293, 209, 58, ref englishSearchSongNormalBackground, ref englishSearchSongActiveBackground, 1197, 280, 225, 50, ref englishSearchSongNormalBackground, ref englishSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, EnglishSearchSongsButton_Click); normalStateImageSongQuery, mouseDownImageSongQuery, EnglishSearchSongsButton_Click);
// 初始化「拼音搜尋」按鈕 // 初始化「拼音搜尋」按鈕
InitializeSearchButton(ref pinyinSearchSongButton, "pinyinSearchSongButton", InitializeSearchButton(ref pinyinSearchSongButton, "pinyinSearchSongButton",
1214, 356, 209, 58, ref pinyinSearchSongNormalBackground, ref pinyinSearchSongActiveBackground, 1197, 335, 225, 50, ref pinyinSearchSongNormalBackground, ref pinyinSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, PinyinSearchSongsButton_Click); normalStateImageSongQuery, mouseDownImageSongQuery, PinyinSearchSongsButton_Click);
// 初始化「筆劃搜尋」按鈕 // 初始化「筆劃搜尋」按鈕
InitializeSearchButton(ref wordCountSearchSongButton, "wordCountSearchSongButton", InitializeSearchButton(ref wordCountSearchSongButton, "wordCountSearchSongButton",
1214, 418, 209, 59, ref wordCountSearchSongNormalBackground, ref wordCountSearchSongActiveBackground, 1197, 390, 225, 50, ref wordCountSearchSongNormalBackground, ref wordCountSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, WordCountSearchSongsButton_Click); normalStateImageSongQuery, mouseDownImageSongQuery, WordCountSearchSongsButton_Click);
// 初始化「手寫搜尋」按鈕 // 初始化「手寫搜尋」按鈕
InitializeSearchButton(ref handWritingSearchSongButton, "handWritingSearchSongButton", InitializeSearchButton(ref handWritingSearchSongButton, "handWritingSearchSongButton",
1214, 481, 209, 59, ref handWritingSearchSongNormalBackground, ref handWritingSearchSongActiveBackground, 1197, 445, 225, 50, ref handWritingSearchSongNormalBackground, ref handWritingSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, HandWritingSearchButtonForSongs_Click); normalStateImageSongQuery, mouseDownImageSongQuery, HandWritingSearchButtonForSongs_Click);
// 初始化「數字搜尋」按鈕 // 初始化「數字搜尋」按鈕
InitializeSearchButton(ref numberSearchSongButton, "numberSearchSongButton", InitializeSearchButton(ref numberSearchSongButton, "numberSearchSongButton",
1214, 544, 209, 58, ref numberSearchSongNormalBackground, ref numberSearchSongActiveBackground, 1197, 500, 225, 50, ref numberSearchSongNormalBackground, ref numberSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, SongIDSearchSongsButton_Click); normalStateImageSongQuery, mouseDownImageSongQuery, SongIDSearchSongsButton_Click);
} }
} }

1099
config.ini

File diff suppressed because it is too large Load Diff