介面圖片更新

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

View File

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

View File

@ -57,12 +57,12 @@ namespace DualScreenDemo
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);
isOnOrderedSongsPage = false;
/* 清空搜尋欄 */
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);
UpdateSongList(guoYuSongs);
@ -90,7 +90,7 @@ namespace DualScreenDemo
{
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);
UpdateSongList(selectedSongs);
@ -147,61 +147,61 @@ namespace DualScreenDemo
private void InitializeButtonsForHotSong()
{
InitializeHotSongButton(ref guoYuNewSongButtonHotSong, "國語新歌", 1214, 230, 209, 58,
normalStateImageHotSong,
out guoYuNewSongHotSongNormalBackground,
mouseDownImageHotSong,
InitializeHotSongButton(ref guoYuNewSongButtonHotSong, "國語新歌", 1197, 225, 225, 50,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語新歌排行(未按).png")),
out guoYuNewSongHotSongNormalBackground,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語新歌排行(已按).png")),
out guoYuNewSongHotSongActiveBackground,
GuoYuNewSongButtonHotSong_Click);
InitializeHotSongButton(ref taiYuNewSongButtonHotSong, "台語新歌", 1214, 293, 209, 58,
normalStateImageHotSong,
out taiYuNewSongHotSongNormalBackground,
mouseDownImageHotSong,
InitializeHotSongButton(ref taiYuNewSongButtonHotSong, "台語新歌", 1197, 280, 225, 50,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語新歌排行(未按).png")),
out taiYuNewSongHotSongNormalBackground,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語新歌排行(已按).png")),
out taiYuNewSongHotSongActiveBackground,
TaiYuNewSongButtonHotSong_Click);
InitializeHotSongButton(ref taiYuButtonHotSong, "台語", 1214, 418, 209, 58,
normalStateImageHotSong,
out taiYuHotSongNormalBackground,
mouseDownImageHotSong,
InitializeHotSongButton(ref taiYuButtonHotSong, "台語", 1197, 335, 225, 50,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語人氣排行(未按).png")),
out taiYuHotSongNormalBackground,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語人氣排行(已按).png")),
out taiYuHotSongActiveBackground,
TaiYuButtonHotSong_Click);
InitializeHotSongButton(ref yueYuButtonHotSong, "粵語", 1214, 356, 209, 58,
normalStateImageHotSong,
out yueYuHotSongNormalBackground,
mouseDownImageHotSong,
out yueYuHotSongActiveBackground,
YueYuButtonHotSong_Click);
//InitializeHotSongButton(ref yueYuButtonHotSong, "粵語", 1197, 390, 225, 50,
// normalStateImageHotSong,
// out yueYuHotSongNormalBackground,
// mouseDownImageHotSong,
// out yueYuHotSongActiveBackground,
// YueYuButtonHotSong_Click);
InitializeHotSongButton(ref guoYuButtonHotSong, "國語", 1214, 356, 209, 59,
normalStateImageHotSong,
out guoYuHotSongNormalBackground,
mouseDownImageHotSong,
InitializeHotSongButton(ref guoYuButtonHotSong, "國語", 1197, 390, 225, 50,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語人氣排行(未按).png")),
out guoYuHotSongNormalBackground,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語人氣排行(已按).png")),
out guoYuHotSongActiveBackground,
GuoYuButtonHotSong_Click);
InitializeHotSongButton(ref yingWenButtonHotSong, "英文", 1214, 481, 209, 59,
normalStateImageHotSong,
out yingWenHotSongNormalBackground,
mouseDownImageHotSong,
InitializeHotSongButton(ref yingWenButtonHotSong, "英文", 1197, 445, 225, 50,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_英語人氣排行(未按).png")),
out yingWenHotSongNormalBackground,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_英語人氣排行(已按).png")),
out yingWenHotSongActiveBackground,
YingWenButtonHotSong_Click);
InitializeHotSongButton(ref riYuButtonHotSong, "日語", 1214, 544, 209, 59,
normalStateImageHotSong,
out riYuHotSongNormalBackground,
mouseDownImageHotSong,
InitializeHotSongButton(ref riYuButtonHotSong, "日語", 1197, 500, 225, 50,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_日語人氣排行(未按).png")),
out riYuHotSongNormalBackground,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_日語人氣排行(已按).png")),
out riYuHotSongActiveBackground,
RiYuButtonHotSong_Click);
InitializeHotSongButton(ref hanYuButtonHotSong, "韓語", 1214, 607, 209, 58,
normalStateImageHotSong,
out hanYuHotSongNormalBackground,
mouseDownImageHotSong,
InitializeHotSongButton(ref hanYuButtonHotSong, "韓語", 1197, 555, 225, 50,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_韓語人氣排行(未按).png")),
out hanYuHotSongNormalBackground,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_韓語人氣排行(已按).png")),
out hanYuHotSongActiveBackground,
HanYuButtonHotSong_Click);
@ -221,9 +221,12 @@ namespace DualScreenDemo
// 修改裁剪區域,避開文字部分
Rectangle cropArea = new Rectangle(1214, y, 209, 58); // 使用固定的裁剪區域
normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat);
activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat);
//normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat);
//activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat);
normalBackgroundOut = new Bitmap(normalBackground);
activeBackgroundOut = new Bitmap(activeBackground);
button.BackgroundImage = normalBackgroundOut;
button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat;

View File

@ -7,7 +7,7 @@ namespace DualScreenDemo
// 重置其他按钮背景
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);
currentPage = 0;

View File

@ -7,7 +7,7 @@ namespace DualScreenDemo
// 重置其他按钮背景
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);
currentPage = 0;

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private void InitializeGuoYuButton()
{
Rectangle guoYuButtonCropArea = new Rectangle(1214, 230, 209, 59);
InitializeButton(ref guoYuButton, "國語", 1214, 230, 209, 59, guoYuButtonCropArea, normalStateImageLanguageQuery, out guoYuNormalBackground, mouseDownImageLanguageQuery, out guoYuActiveBackground, GuoYuButton_Click);
Rectangle guoYuButtonCropArea = new Rectangle(1197, 225, 225, 20);
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)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private void InitializeHanYuButton()
{
Rectangle hanYuButtonCropArea = new Rectangle(1214, 544, 209, 58);
InitializeButton(ref hanYuButton, "韓語", 1214, 544, 209, 58, hanYuButtonCropArea, normalStateImageLanguageQuery, out hanYuNormalBackground, mouseDownImageLanguageQuery, out hanYuActiveBackground, HanYuButton_Click);
Rectangle hanYuButtonCropArea = new Rectangle(1197, 500, 225, 50);
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)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private void InitializeKeYuButton()
{
Rectangle keYuButtonCropArea = new Rectangle(1214, 607, 209, 58);
InitializeButton(ref keYuButton, "客語", 1214, 607, 209, 58, keYuButtonCropArea, normalStateImageLanguageQuery, out keYuNormalBackground, mouseDownImageLanguageQuery, out keYuActiveBackground, KeYuButton_Click);
Rectangle keYuButtonCropArea = new Rectangle(1197, 555, 225, 50);
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)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private void InitializeRiYuButton()
{
Rectangle riYuButtonCropArea = new Rectangle(1214, 481, 209, 59);
InitializeButton(ref riYuButton, "日語", 1214, 481, 209, 59, riYuButtonCropArea, normalStateImageLanguageQuery, out riYuNormalBackground, mouseDownImageLanguageQuery, out riYuActiveBackground, RiYuButton_Click);
Rectangle riYuButtonCropArea = new Rectangle(1197, 445, 225, 50);
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)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private void InitializeTaiYuButton()
{
Rectangle taiYuButtonCropArea = new Rectangle(1214, 293, 209, 58);
InitializeButton(ref taiYuButton, "台語", 1214, 293, 209, 58, taiYuButtonCropArea, normalStateImageLanguageQuery, out taiYuNormalBackground, mouseDownImageLanguageQuery, out taiYuActiveBackground, TaiYuButton_Click);
Rectangle taiYuButtonCropArea = new Rectangle(1197, 280, 225, 50);
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)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private void InitializeYingWenButton()
{
Rectangle yingWenButtonCropArea = new Rectangle(1214, 418, 209, 59);
InitializeButton(ref yingWenButton, "英文", 1214, 418, 209, 59, yingWenButtonCropArea, normalStateImageLanguageQuery, out yingWenNormalBackground, mouseDownImageLanguageQuery, out yingWenActiveBackground, YingWenButton_Click);
Rectangle yingWenButtonCropArea = new Rectangle(1197, 390, 225, 50);
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)

View File

@ -1,11 +1,13 @@
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private void InitializeYueYuButton()
{
Rectangle yueYuButtonCropArea = new Rectangle(1214, 356, 209, 58);
InitializeButton(ref yueYuButton, "粵語", 1214, 356, 209, 58, yueYuButtonCropArea, normalStateImageLanguageQuery, out yueYuNormalBackground, mouseDownImageLanguageQuery, out yueYuActiveBackground, YueYuButton_Click);
Rectangle yueYuButtonCropArea = new Rectangle(1197, 335, 225, 50);
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)

View File

@ -12,8 +12,10 @@ namespace DualScreenDemo
{
button = new Button { Text = "", Visible = false };
ResizeAndPositionButton(button, x, y, width, height);
normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat);
activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat);
//normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat);
//activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat);
normalBackgroundOut = new Bitmap(normalBackground);
activeBackgroundOut = new Bitmap(activeBackground);
button.BackgroundImage = normalBackgroundOut;
button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat;
@ -56,7 +58,7 @@ namespace DualScreenDemo
hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchActiveBackground;
languageSearchButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_語別查詢(已按).png"));
groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
@ -75,7 +77,7 @@ namespace DualScreenDemo
/* 清空搜尋欄 */
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);
currentPage = 0;
totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage);
@ -120,7 +122,7 @@ namespace DualScreenDemo
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);
currentPage = 0;

View File

@ -60,7 +60,8 @@ namespace DualScreenDemo
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;
singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground;
@ -82,10 +83,7 @@ namespace DualScreenDemo
/* 清空搜尋欄 */
ResetinputBox();
/*guoYuSongs2 = allSongs.Where(song => song.Category == "國語")
.OrderByDescending(song => song.AddedTime)
.Take(songLimit)
.ToList();*/
string query = setQueryforNewSong("國語");
var guoYuSongs2 = SearchSongs_Mysql(query);
currentPage = 0;
@ -124,10 +122,10 @@ namespace DualScreenDemo
guoYuButtonNewSong = new Button{ Text = "", Visible = false };
ResizeAndPositionButton(guoYuButtonNewSong, 1214, 230, 209, 59);
Rectangle guoYuNewSongButtonCropArea = new Rectangle(1214, 230, 209, 59);
guoYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(guoYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat);
guoYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(guoYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat);
ResizeAndPositionButton(guoYuButtonNewSong, 1197, 225, 225, 50);
Rectangle guoYuNewSongButtonCropArea = new Rectangle(1197, 225, 225, 50);
guoYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_國語(未按).png"));
guoYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_國語(已按).png"));
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
guoYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
guoYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -140,10 +138,10 @@ namespace DualScreenDemo
taiYuButtonNewSong = new Button { Text = "", Visible = false };
ResizeAndPositionButton(taiYuButtonNewSong, 1214, 293, 209, 58);
Rectangle taiYuNewSongButtonCropArea = new Rectangle(1214, 293, 209, 58);
taiYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(taiYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat);
taiYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(taiYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat);
ResizeAndPositionButton(taiYuButtonNewSong, 1197, 280, 225, 50);
Rectangle taiYuNewSongButtonCropArea = new Rectangle(1197, 280, 225, 50);
taiYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_台語(未按).png"));
taiYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_台語(已按).png"));
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
taiYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
taiYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -156,10 +154,10 @@ namespace DualScreenDemo
yueYuButtonNewSong = new Button { Text = "", Visible = false };
ResizeAndPositionButton(yueYuButtonNewSong, 1214, 356, 209, 58);
Rectangle yueYuNewSongButtonCropArea = new Rectangle(1214, 356, 209, 58);
yueYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(yueYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat);
yueYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(yueYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat);
ResizeAndPositionButton(yueYuButtonNewSong, 1197, 335, 225, 50);
Rectangle yueYuNewSongButtonCropArea = new Rectangle(1197, 335, 225, 50);
yueYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_粵語(未按).png"));
yueYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_粵語(已按).png"));
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
yueYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -172,10 +170,10 @@ namespace DualScreenDemo
yingWenButtonNewSong = new Button {Visible = false };
ResizeAndPositionButton(yingWenButtonNewSong, 1214, 418, 209, 59);
Rectangle yingWenNewSongButtonCropArea = new Rectangle(1214, 418, 209, 59);
yingWenNewSongNormalBackground = normalStateImageNewSongAlert.Clone(yingWenNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat);
yingWenNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(yingWenNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat);
ResizeAndPositionButton(yingWenButtonNewSong, 1197, 390, 225, 50);
Rectangle yingWenNewSongButtonCropArea = new Rectangle(1197, 390, 225, 50);
yingWenNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_英語(未按).png"));
yingWenNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_英語(已按).png"));
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
yingWenButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -188,10 +186,10 @@ namespace DualScreenDemo
riYuButtonNewSong = new Button { Visible = false };
ResizeAndPositionButton(riYuButtonNewSong, 1214, 481, 209, 59);
Rectangle riYuNewSongButtonCropArea = new Rectangle(1214, 481, 209, 59);
riYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(riYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat);
riYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(riYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat);
ResizeAndPositionButton(riYuButtonNewSong, 1197, 445, 225, 50);
Rectangle riYuNewSongButtonCropArea = new Rectangle(1197, 445, 225, 50);
riYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_日語(未按).png"));
riYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_日語(已按).png"));
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
riYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
riYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -204,10 +202,10 @@ namespace DualScreenDemo
hanYuButtonNewSong = new Button {Visible = false };
ResizeAndPositionButton(hanYuButtonNewSong, 1214, 544, 209, 58);
Rectangle hanYuNewSongButtonCropArea = new Rectangle(1214, 544, 209, 58);
hanYuNewSongNormalBackground = normalStateImageNewSongAlert.Clone(hanYuNewSongButtonCropArea, normalStateImageNewSongAlert.PixelFormat);
hanYuNewSongActiveBackground = mouseDownImageNewSongAlert.Clone(hanYuNewSongButtonCropArea, mouseDownImageNewSongAlert.PixelFormat);
ResizeAndPositionButton(hanYuButtonNewSong, 1197, 500, 225, 50);
Rectangle hanYuNewSongButtonCropArea = new Rectangle(1197, 500, 490, 50);
hanYuNewSongNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_韓語(未按).png"));
hanYuNewSongActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_韓語(已按).png"));
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
hanYuButtonNewSong.FlatStyle = FlatStyle.Flat;
@ -219,7 +217,7 @@ namespace DualScreenDemo
}
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;
}

View File

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

View File

@ -53,15 +53,15 @@ namespace DualScreenDemo
// 配置各個按鈕
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;
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;
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;
this.Controls.Add(previousPromotionButton);
@ -88,7 +88,7 @@ namespace DualScreenDemo
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsActiveBackground;
promotionsButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_優惠活動(已按).png"));
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false;

View File

@ -11,7 +11,7 @@ namespace DualScreenDemo
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))
{
Console.WriteLine("Base image not found: " + imagePath);
@ -66,7 +66,7 @@ namespace DualScreenDemo
// g.DrawImage(baseImage, 0, 0);
// cropped qrcode 版型不同設定調整
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);
}
@ -79,28 +79,26 @@ namespace DualScreenDemo
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.Name = "closeQRCodeButton";
ResizeAndPositionButton(closeQRCodeButton, 1173, 448, 22, 22);
closeQRCodeButton.BackgroundImage = closeQRCodeCroppedImage;
closeQRCodeButton.Location = new Point(259, 7);
closeQRCodeButton.Size = new Size(30, 30);
closeQRCodeButton.BackColor = Color.Transparent;
closeQRCodeButton.BackgroundImageLayout = ImageLayout.Stretch;
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;
this.Controls.Add(closeQRCodeButton);
pictureBoxQRCode.Controls.Add(closeQRCodeButton);
}
catch (Exception ex)
{

View File

@ -29,8 +29,10 @@ namespace DualScreenDemo
{
Name = "constructionButton",
};
ConfigureButton(constructionButton, 876, 494, 148, 64,
resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects,
ConfigureButton(constructionButton, 876, 494, 148, 64,
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);
this.Controls.Add(constructionButton);
@ -40,7 +42,9 @@ namespace DualScreenDemo
Name = "marketButton",
};
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);
this.Controls.Add(marketButton);
@ -50,7 +54,9 @@ namespace DualScreenDemo
Name = "drivingButton",
};
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);
this.Controls.Add(drivingButton);
@ -59,8 +65,10 @@ namespace DualScreenDemo
{
Name = "airportButton",
};
ConfigureButton(airportButton, 1037, 570, 148, 63,
resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects, resizedNormalStateImageForSceneSoundEffects,
ConfigureButton(airportButton, 1037, 570, 148, 63,
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);
this.Controls.Add(airportButton);
@ -70,7 +78,9 @@ namespace DualScreenDemo
Name = "officeButton",
};
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);
this.Controls.Add(officeButton);
@ -81,7 +91,9 @@ namespace DualScreenDemo
};
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);
this.Controls.Add(closeButton);
}
@ -96,7 +108,7 @@ namespace DualScreenDemo
if (!pictureBoxSceneSoundEffects.Visible)
{
ShowImageOnPictureBoxSceneSoundEffects(Path.Combine(Application.StartupPath, @"themes\superstar\555022.jpg"));
ShowImageOnPictureBoxSceneSoundEffects(Path.Combine(Application.StartupPath, @"themes\superstar\button\3.介面\場景音效_空白介面.png"));
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(true);
}
else
@ -147,7 +159,7 @@ namespace DualScreenDemo
Bitmap croppedImage = CropImage(originalImage, cropArea);
pictureBoxSceneSoundEffects.Image = croppedImage;
pictureBoxSceneSoundEffects.Image = originalImage;
ResizeAndPositionPictureBox(pictureBoxSceneSoundEffects, cropArea.X, cropArea.Y, cropArea.Width, cropArea.Height);

View File

@ -1,4 +1,5 @@
using OverlayFormObj;
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm : Form
@ -40,35 +41,82 @@ namespace DualScreenDemo
this.primaryScreenPanel.BackColor = System.Drawing.Color.Black;
// 同步畫面 服務鈴
ConfigureButton(this.syncServiceBellButton, 1240, 17, 161, 161,
resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen,
ConfigureButton(this.syncServiceBellButton, 1240, 17, 161, 161,
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)=>OnServiceBellButtonClick(sender,e));
ConfigureButton(this.syncCutSongButton, 1218, 195, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, (sender, e) => videoPlayerForm.PlayNextSong());
ConfigureButton(this.syncReplayButton, 1218, 265, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, ReplayButton_Click);
ConfigureButton(this.syncCutSongButton, 1218, 195, 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")), (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.syncMuteButton, 1218, 406, 205, 55, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, MuteUnmuteButton_Click);
ConfigureButton(this.syncPauseButton, 1218, 475, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, SyncPauseButton_Click);
ConfigureButton(this.syncPlayButton, 1218, 475, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, SyncPlayButton_Click);
ConfigureButton(this.syncVolumeUpButton, 1218, 546, 205, 55, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, null);
ConfigureButton(this.syncOriginalSongButton, 1218, 335, 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")), (sender,e) => videoPlayerForm.ToggleVocalRemoval());
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.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.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.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.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 static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
namespace DualScreenDemo
{
public partial class PrimaryForm
public partial class PrimaryForm : Form
{
private Button btnTurnOn;
private Button btnTurnOff;
private Button btnBright;
@ -19,49 +22,58 @@ namespace DualScreenDemo
private Button btnBrightnessDown1;
private Button btnBrightnessUp2;
private Button btnBrightnessDown2;
private int OnOffState;
private PictureBox pictureBoxToggleLight;
private PictureBox Brightness1;
private PictureBox Brightness2;
private void InitializeButtonsForPictureBoxToggleLight()
{
btnTurnOn = new Button{ Text = "" };
ConfigureButton(btnTurnOn, 604, 410, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnTurnOn = new Button { Text = "" };
ConfigureButton(btnTurnOn, 29, 45, 250, 67,
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\3.介面\\燈光控制_ON-OFF.png")),
null);
btnTurnOn.Click += (sender, e) =>
{
if (SerialPortManager.mySerialPort != null && SerialPortManager.mySerialPort.IsOpen)
if (OnOffState == 1)
{
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 };
Console.WriteLine("light on");
SerialPortManager.mySerialPort.Write(commandBytes, 0, commandBytes.Length);
OnOffState = 1;
}
else
{
MessageBox.Show("Serial port is not open. Cannot send track correction command.");
}
};
btnTurnOff = new Button{ Text = "" };
ConfigureButton(btnTurnOff, 753, 411, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
btnTurnOff.Click += (sender, e) =>
{
SendCommandThroughSerialPort("a2 dc a4");
};
//btnTurnOff = new Button { Text = "" };
//ConfigureButton(btnTurnOff, 753, 411, 122, 62,
// resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
// (sender, e) => SendCommandThroughSerialPort("a2 dc a4"));
btnBright = new Button{ Text = "" };
ConfigureButton(btnBright, 901, 411, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
ConfigureButton(btnBright, 295, 45, 118, 65,
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);
btnBright.Click += (sender, e) =>
{
@ -80,217 +92,185 @@ namespace DualScreenDemo
}
};
btnRomantic = new Button{ Text = "" };
ConfigureButton(btnRomantic, 1049, 411, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnRomantic = new Button{ Text = "" };
ConfigureButton(btnRomantic, 430, 45, 118, 65,
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 d7 a4"));
btnAuto = new Button{ Text = "" };
ConfigureButton(btnAuto, 1049, 494, 123, 63,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnAuto = new Button{ Text = "" };
ConfigureButton(btnAuto, 430, 125, 118, 65,
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);
btnColorTuning = new Button{ Text = "" };
ConfigureButton(btnColorTuning, 1049, 579, 123, 63,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnColorTuning = new Button{ Text = "" };
ConfigureButton(btnColorTuning, 430, 203, 118, 65,
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 75 a4"));
btnSoft = new Button{ Text = "" };
ConfigureButton(btnSoft, 901, 495, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnSoft = new Button{ Text = "" };
ConfigureButton(btnSoft, 295, 125, 118, 65,
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 d6 a4"));
btnDynamic = new Button{ Text = "" };
ConfigureButton(btnDynamic, 901, 579, 123, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnDynamic = new Button{ Text = "" };
ConfigureButton(btnDynamic, 295, 203, 118, 65,
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 d8 a4"));
btnDeskLamp = new Button{ Text = "" };
ConfigureButton(btnDeskLamp, 1048, 662, 124, 64,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnDeskLamp = new Button{ Text = "" };
ConfigureButton(btnDeskLamp, 430, 283, 118, 65,
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 fb a4"));
btnStageLight = new Button{ Text = "" };
ConfigureButton(btnStageLight, 900, 662, 124, 64,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
ConfigureButton(btnStageLight, 295, 283, 118, 65,
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 fa a4"));
btnShelfLight = new Button{ Text = "" };
ConfigureButton(btnShelfLight, 752, 662, 124, 64,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
ConfigureButton(btnShelfLight, 163, 283, 118, 65,
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 f9 a4"));
btnWallLight = new Button{ Text = "" };
ConfigureButton(btnWallLight, 604, 662, 124, 64,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
btnWallLight = new Button{ Text = "" };
ConfigureButton(btnWallLight, 29, 283, 118, 65,
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 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 = "" };
ConfigureButton(btnBrightnessUp1, 603, 495, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
ConfigureTransButton(btnBrightnessUp1, 1, 1, 116, 40, null);
btnBrightnessUp1.MouseDown += (sender, e) =>
{
lightControlTimer.Tag = "a2 d9 a4";
lightControlTimer.Start();
};
btnBrightnessUp1.MouseUp += (sender, e) =>
{
lightControlTimer.Stop();
};
btnBrightnessDown1 = new Button{ Text = "" };
ConfigureButton(btnBrightnessDown1, 605, 579, 122, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
ConfigureTransButton(btnBrightnessDown1, 1, 100, 116, 42, null);
btnBrightnessDown1.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 da a4"; lightControlTimer.Start(); };
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 = "" };
ConfigureButton(btnBrightnessUp2, 753, 495, 123, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
ConfigureTransButton(btnBrightnessUp2, 1, 1, 116, 42, null);
btnBrightnessUp2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f6 a4"; lightControlTimer.Start(); };
btnBrightnessUp2.MouseUp += (sender, e) => { lightControlTimer.Stop(); };
btnBrightnessDown2 = new Button{ Text = "" };
ConfigureButton(btnBrightnessDown2, 753, 579, 123, 62,
resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl, resizedNormalStateImageForLightControl,
null);
ConfigureTransButton(btnBrightnessDown2, 1, 100, 116, 42, null);
btnBrightnessDown2.MouseDown += (sender, e) => { lightControlTimer.Tag = "a2 f7 a4"; lightControlTimer.Start(); };
btnBrightnessDown2.MouseUp += (sender, e) => { lightControlTimer.Stop(); };
this.Controls.Add(btnTurnOn);
this.Controls.Add(btnTurnOff);
this.Controls.Add(btnBright);
this.Controls.Add(btnRomantic);
this.Controls.Add(btnAuto);
this.Controls.Add(btnColorTuning);
this.Controls.Add(btnSoft);
this.Controls.Add(btnDynamic);
this.Controls.Add(btnDeskLamp);
this.Controls.Add(btnStageLight);
this.Controls.Add(btnShelfLight);
this.Controls.Add(btnWallLight);
this.Controls.Add(btnBrightnessUp1);
this.Controls.Add(btnBrightnessDown1);
this.Controls.Add(btnBrightnessUp2);
this.Controls.Add(btnBrightnessDown2);
pictureBoxToggleLight.Controls.Add(btnTurnOn);
pictureBoxToggleLight.Controls.Add(btnBright);
pictureBoxToggleLight.Controls.Add(btnRomantic);
pictureBoxToggleLight.Controls.Add(btnAuto);
pictureBoxToggleLight.Controls.Add(btnColorTuning);
pictureBoxToggleLight.Controls.Add(btnSoft);
pictureBoxToggleLight.Controls.Add(btnDynamic);
pictureBoxToggleLight.Controls.Add(btnDeskLamp);
pictureBoxToggleLight.Controls.Add(btnStageLight);
pictureBoxToggleLight.Controls.Add(btnShelfLight);
pictureBoxToggleLight.Controls.Add(btnWallLight);
Brightness1.Controls.Add(btnBrightnessUp1);
Brightness1.Controls.Add(btnBrightnessDown1);
Brightness2.Controls.Add(btnBrightnessUp2);
Brightness2.Controls.Add(btnBrightnessDown2);
pictureBoxToggleLight.Controls.Add(Brightness1);
pictureBoxToggleLight.Controls.Add(Brightness2);
}
private void ToggleLightButton_Click(object sender, EventArgs e)
{
SetHotSongButtonsVisibility(false);
SetNewSongButtonsVisibility(false);
SetSingerSearchButtonsVisibility(false);
SetSongSearchButtonsVisibility(false);
//SetHotSongButtonsVisibility(false);
//SetNewSongButtonsVisibility(false);
//SetSingerSearchButtonsVisibility(false);
//SetSongSearchButtonsVisibility(false);
if (!pictureBoxToggleLight.Visible)
{
ShowImageOnPictureBoxToggleLight(Path.Combine(Application.StartupPath, @"themes\superstar\選單內介面_燈光控制.jpg"));
SetPictureBoxToggleLightAndButtonsVisibility(true);
pictureBoxToggleLight.Size = new Size(630, 379);
pictureBoxToggleLight.Location = new Point(570, 359);
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
{
TogglePictureBoxToggleLightButtonsVisibility();
CloseUI(pictureBoxToggleLight);
}
if (pictureBoxQRCode != null)
{
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)
{
pictureBoxToggleLight.Visible = isVisible;
btnTurnOn.Visible = isVisible;
btnTurnOff.Visible = isVisible;
//btnTurnOff.Visible = isVisible;
btnBright.Visible = isVisible;
btnRomantic.Visible = isVisible;
btnAuto.Visible = isVisible;
@ -308,12 +288,12 @@ namespace DualScreenDemo
if (isVisible)
{
pictureBoxToggleLight.BringToFront();
btnTurnOn.BringToFront();
btnTurnOff.BringToFront();
//btnTurnOff.BringToFront();
btnBright.BringToFront();
btnRomantic.BringToFront();
btnAuto.BringToFront();

View File

@ -198,7 +198,7 @@ namespace DualScreenDemo
lightControlTimer = new Timer();
lightControlTimer.Interval = 5;
lightControlTimer.Tick += LightControlTimer_Tick;
InitializeRecording();
InitializeMediaPlayer();
LoadImages();
@ -220,7 +220,6 @@ namespace DualScreenDemo
multiPagePanel.PageIndexChanged += HandlePageChanged;
// 添加 Load 事件處理
this.Load += PrimaryForm_Load;
}
// 添加 DPI 感知支持
@ -244,15 +243,13 @@ namespace DualScreenDemo
{
// 取得本機電腦的主機名稱 (hostname)
string hostName = System.Net.Dns.GetHostName();
string version = Program.verSion;
// 顯示包廂名稱
// 取主機名稱的最後 20 個字元 (如果長度不足 20則取全部)
string displayName = "包廂" + hostName.Substring(Math.Max(0, hostName.Length - 3));
string totalPages = multiPagePanel.totalPages.ToString() == "0" ? "1" : multiPagePanel.totalPages.ToString();
string pageNumber = (multiPagePanel.currentPageIndex + 1).ToString() + "/" + totalPages;
// 最後確定要塗鴉的值
displayName = displayName + " " + pageNumber;
// 基準解析度(你目前的設計基準)
float baseWidth = 1920f;
@ -276,13 +273,14 @@ namespace DualScreenDemo
Brush brush = new SolidBrush(Color.Red);
// 設定繪製文字的位置 (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(要繪製的文字, 字型, 畫刷, 位置)`
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)
{
@ -467,7 +465,7 @@ namespace DualScreenDemo
string selectedTheme = ReadSelectedThemePath();
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
{
using (Image originalImage = Image.FromFile(backgroundImagePath))
@ -943,152 +941,239 @@ namespace DualScreenDemo
ResizeAndPositionButton(button, posX, posY, width, 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.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0;
button.FlatAppearance.MouseDownBackColor = Color.Transparent;
button.FlatAppearance.MouseOverBackColor = Color.Transparent;
button.FlatAppearance.MouseOverBackColor = Color.Transparent;
button.MouseEnter += (sender, e) => button.BackgroundImage = mouseOverImage.Clone(cropArea, mouseOverImage.PixelFormat);
button.MouseLeave += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
button.MouseDown += (sender, e) => button.BackgroundImage = mouseDownImage.Clone(cropArea, mouseDownImage.PixelFormat);
button.MouseUp += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
//button.MouseEnter += (sender, e) => button.BackgroundImage = mouseOverImage.Clone(cropArea, mouseOverImage.PixelFormat);
//button.MouseLeave += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
//button.MouseDown += (sender, e) => button.BackgroundImage = mouseDownImage.Clone(cropArea, mouseDownImage.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)
{
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);
}
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);
serviceBellButton = new Button { Text = "" };
serviceBellButton.Name = "serviceBellButton";
ConfigureButton(serviceBellButton, 848, 96, 101, 102,
resizedNormalStateImage, resizedMouseOverImage, resizedMouseDownImage,
(sender, e) => OnServiceBellButtonClick(sender, e));
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);
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;
InitializeButton(ref orderedSongsButton, ref orderedSongsNormalBackground, ref orderedSongsActiveBackground, "orderedSongsButton", 966, 97, 100, 99, "themes\\superstar\\ICON上方\\上方ICON_已點歌曲-09.png", OrderedSongsButton_Click);
InitializeButton(ref myFavoritesButton, ref myFavoritesNormalBackground, ref myFavoritesActiveBackground, "myFavoritesButton", 1084, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_我的最愛-10.png", MyFavoritesButton_Click);
InitializeButton(ref orderedSongsButton, ref orderedSongsNormalBackground, ref orderedSongsActiveBackground, "orderedSongsButton", 961, 98, 107, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_已點歌曲(未按).png", OrderedSongsButton_Click);
InitializeButton(ref promotionsButton, ref promotionsNormalBackground, ref promotionsActiveBackground, "promotionsButton", 1202, 97, 99, 99, "themes\\superstar\\ICON上方\\上方ICON_優惠活動-11.png", promotionsButton_Click);
InitializeButton(ref myFavoritesButton, ref myFavoritesNormalBackground, ref myFavoritesActiveBackground, "myFavoritesButton", 1079, 98, 107, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_我的最愛(未按).png", MyFavoritesButton_Click);
InitializeButton(ref deliciousFoodButton, ref deliciousFoodNormalBackground, ref deliciousFoodActiveBackground, "deliciousFoodButton", 1320, 97, 98, 99, "themes\\superstar\\ICON上方\\上方ICON_美味菜單-12.png", DeliciousFoodButton_Click);
InitializeButton(ref promotionsButton, ref promotionsNormalBackground, ref promotionsActiveBackground, "promotionsButton", 1197, 98, 107, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_優惠活動(未按).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", 1315, 98, 107, 120, "themes\\superstar\\button\\1.主類別\\主類別上方_美味菜單(未按).png", DeliciousFoodButton_Click);
qieGeButton = new Button{ Text = "" };
qieGeButton.Name = "qieGeButton";
ConfigureButton(qieGeButton, 28, 755, 92, 132,
resizedNormalStateImage, resizedNormalStateImage, resizedNormalStateImage,
(sender, e) => videoPlayerForm.PlayNextSong());
//mobileSongRequestButton = new Button { Text = "" };
//mobileSongRequestButton.Name = "mobileSongRequestButton";
//ConfigureButton(mobileSongRequestButton, 1211, 669, 210, 70,
// resizedNormalStateImage, resizedMouseOverImage, resizedMouseDownImage,
// MobileSongRequestButton_Click);
Bitmap mobileSongRequest = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png"));
Rectangle mobileSongRequestButtonCropArea = new Rectangle(1198, 629, 223, 88);
InitializeButton(
ref mobileSongRequestButton,
"mobileSongRequestButton",
1198, 629, 223, 88,
mobileSongRequestButtonCropArea,
mobileSongRequest,
MobileSongRequestButton_Click
);
Bitmap qieGe=new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png"));
Rectangle qieGeButtonCropArea = new Rectangle(20, 738, 92, 147);
InitializeButton(
ref qieGeButton,
"qieGeButton",
20, 738, 92, 147,
qieGeButtonCropArea,
qieGe,
(sender, e) => videoPlayerForm.PlayNextSong()
);
this.Controls.Add(qieGeButton);
musicUpButton = new Button{ Text = "" };
musicUpButton.Name = "musicUpButton";
ResizeAndPositionButton(musicUpButton, 136, 754, 92, 58);
Rectangle musicUpButtonCropArea = new Rectangle(136, 754, 92, 58);
musicUpButton.BackgroundImage = normalStateImage.Clone(musicUpButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(musicUpButton, 128, 738, 93, 62);
Rectangle musicUpButtonCropArea = new Rectangle(128, 738, 93, 62);
//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.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.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);
musicDownButton = new Button{ Text = "" };
musicDownButton.Name = "musicDownButton";
ResizeAndPositionButton(musicDownButton, 136, 827, 92, 57);
Rectangle musicDownButtonCropArea = new Rectangle(136, 827, 92, 57);
musicDownButton.BackgroundImage = normalStateImage.Clone(musicDownButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(musicDownButton, 128, 823, 93, 62);
Rectangle musicDownButtonCropArea = new Rectangle(128, 823, 93, 62);
//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.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.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);
micUpButton = new Button{ Text = "" };
micUpButton.Name = "micUpButton";
ResizeAndPositionButton(micUpButton, 244, 754, 92, 57);
Rectangle micUpButtonCropArea = new Rectangle(244, 754, 92, 57);
micUpButton.BackgroundImage = normalStateImage.Clone(micUpButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(micUpButton, 238, 738, 93, 62);
Rectangle micUpButtonCropArea = new Rectangle(238, 738, 93, 62);
//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.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.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);
micDownButton = new Button{ Text = "" };
micDownButton.Name = "micDownButton";
ResizeAndPositionButton(micDownButton, 244, 827, 92, 57);
Rectangle micDownButtonCropArea = new Rectangle(244, 827, 92, 57);
micDownButton.BackgroundImage = normalStateImage.Clone(micDownButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(micDownButton, 238, 823, 93, 62);
Rectangle micDownButtonCropArea = new Rectangle(238, 823, 93, 62);
//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.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.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);
originalSongButton = new Button { Text = "" };
originalSongButton.Name = "originalSongButton";
ResizeAndPositionButton(originalSongButton, 353, 756, 91, 55);
Rectangle originalSongButtonCropArea = new Rectangle(353, 756, 91, 55);
originalSongButton.BackgroundImage = normalStateImage.Clone(originalSongButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(originalSongButton, 347, 738, 93, 62);
Rectangle originalSongButtonCropArea = new Rectangle(347, 738, 93, 62);
//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.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;
this.Controls.Add(originalSongButton);
replayButton = new Button{ Text = "" };
replayButton.Name = "replayButton";
ResizeAndPositionButton(replayButton, 353, 828, 91, 55);
Rectangle replayButtonCropArea = new Rectangle(353, 828, 91, 55);
replayButton.BackgroundImage = normalStateImage.Clone(replayButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(replayButton, 347, 823, 93, 62);
Rectangle replayButtonCropArea = new Rectangle(347, 823, 93, 62);
//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.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;
this.Controls.Add(replayButton);
@ -1097,12 +1182,16 @@ namespace DualScreenDemo
Text = "",
Name = "pauseButton"
};
ResizeAndPositionButton(pauseButton, 461, 755, 91, 56);
Rectangle pauseButtonCropArea = new Rectangle(461, 755, 91, 56);
pauseButton.BackgroundImage = normalStateImage.Clone(pauseButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(pauseButton, 456, 738, 93, 62);
Rectangle pauseButtonCropArea = new Rectangle(456, 738, 93, 62);
//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.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;
this.Controls.Add(pauseButton);
@ -1112,134 +1201,173 @@ namespace DualScreenDemo
Name = "playButton",
Visible = false
};
ResizeAndPositionButton(playButton, 461, 755, 91, 56);
Rectangle playButtonCropArea = new Rectangle(461, 755, 91, 56);
playButton.BackgroundImage = normalStateImage.Clone(playButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(playButton, 456, 738, 93, 62);
Rectangle playButtonCropArea = new Rectangle(456, 740, 93, 62);
//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.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;
this.Controls.Add(playButton);
muteButton = new Button{ Text = "" };
muteButton.Name = "muteButton";
ResizeAndPositionButton(muteButton, 461, 828, 91, 55);
Rectangle muteButtonCropArea = new Rectangle(461, 828, 91, 55);
muteButton.BackgroundImage = normalStateImage.Clone(muteButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(muteButton, 456, 823, 93, 62);
Rectangle muteButtonCropArea = new Rectangle(456, 823, 93, 62);
//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.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;
this.Controls.Add(muteButton);
maleKeyButton = new Button{ Text = "" };
maleKeyButton.Name = "maleKeyButton";
ResizeAndPositionButton(maleKeyButton, 569, 755, 91, 56);
Rectangle maleKeyButtonCropArea = new Rectangle(569, 755, 91, 56);
maleKeyButton.BackgroundImage = normalStateImage.Clone(maleKeyButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(maleKeyButton, 564, 738, 93, 62);
Rectangle maleKeyButtonCropArea = new Rectangle(564, 738, 93, 62);
//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.FlatStyle = FlatStyle.Flat;
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);
femaleKeyButton = new Button{ Text = "" };
femaleKeyButton.Name = "femaleKeyButton";
ResizeAndPositionButton(femaleKeyButton, 570, 828, 90, 55);
Rectangle femaleKeyButtonCropArea = new Rectangle(570, 828, 90, 55);
femaleKeyButton.BackgroundImage = normalStateImage.Clone(femaleKeyButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(femaleKeyButton, 565, 823, 93, 62);
Rectangle femaleKeyButtonCropArea = new Rectangle(565, 823, 93, 62);
//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.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;
this.Controls.Add(femaleKeyButton);
standardKeyButton = new Button { Text = "" };
standardKeyButton.Name = "standardKeyButton";
ResizeAndPositionButton(standardKeyButton, 677, 757, 91, 56);
Rectangle standardKeyButtonCropArea = new Rectangle(677, 757, 91, 56);
standardKeyButton.BackgroundImage = normalStateImage.Clone(standardKeyButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(standardKeyButton, 674, 738, 93, 62);
Rectangle standardKeyButtonCropArea = new Rectangle(674, 738, 93, 62);
//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.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;
this.Controls.Add(standardKeyButton);
soundEffectButton = new Button { Text = "" };
soundEffectButton.Name = "soundEffectButton";
ResizeAndPositionButton(soundEffectButton, 677, 827, 91, 56);
Rectangle soundEffectButtonCropArea = new Rectangle(677, 827, 91, 56);
soundEffectButton.BackgroundImage = normalStateImage.Clone(soundEffectButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(soundEffectButton, 674, 823, 93, 62);
Rectangle soundEffectButtonCropArea = new Rectangle(674, 823, 93, 62);
//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.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;
this.Controls.Add(soundEffectButton);
pitchUpButton = new Button{ Text = "" };
pitchUpButton.Name = "pitchUpButton";
ResizeAndPositionButton(pitchUpButton, 786, 755, 90, 56);
Rectangle pitchUpButtonCropArea = new Rectangle(786, 755, 90, 56);
pitchUpButton.BackgroundImage = normalStateImage.Clone(pitchUpButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(pitchUpButton, 784, 738, 93, 62);
Rectangle pitchUpButtonCropArea = new Rectangle(784, 738, 93, 62);
//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.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;
this.Controls.Add(pitchUpButton);
pitchDownButton = new Button{ Text = "" };
pitchDownButton.Name = "pitchDownButton";
ResizeAndPositionButton(pitchDownButton, 786, 828, 90, 55);
Rectangle pitchDownButtonCropArea = new Rectangle(786, 828, 90, 55);
pitchDownButton.BackgroundImage = normalStateImage.Clone(pitchDownButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(pitchDownButton, 784, 823, 93, 62);
Rectangle pitchDownButtonCropArea = new Rectangle(784, 823, 93, 62);
//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.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;
this.Controls.Add(pitchDownButton);
syncScreenButton = new Button { Text = "" };
syncScreenButton.Name = "syncScreenButton";
ResizeAndPositionButton(syncScreenButton, 893, 754, 93, 133);
Rectangle syncScreenButtonCropArea = new Rectangle(893, 754, 93, 133);
syncScreenButton.BackgroundImage = normalStateImage.Clone(syncScreenButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(syncScreenButton, 893, 736, 92, 149);
Rectangle syncScreenButtonCropArea = new Rectangle(893, 736, 92, 149);
//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.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;
this.Controls.Add(syncScreenButton);
toggleLightButton = new Button{ Text = "" };
toggleLightButton.Name = "toggleLightButton";
ResizeAndPositionButton(toggleLightButton, 1002, 756, 91, 130);
Rectangle toggleLightButtonCropArea = new Rectangle(1002, 756, 91, 130);
toggleLightButton.BackgroundImage = normalStateImage.Clone(toggleLightButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(toggleLightButton, 1002, 736, 92, 149);
Rectangle toggleLightButtonCropArea = new Rectangle(1002, 736, 92, 149);
//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.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;
this.Controls.Add(toggleLightButton);
Rectangle previousPageButtonCropArea = new Rectangle(1109, 754, 93, 58);
Bitmap PPage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png"));
Rectangle previousPageButtonCropArea = new Rectangle(1110, 738, 93, 62);
InitializeButton(
ref btnPreviousPage,
"btnPreviousPage",
1109, 754, 93, 58,
"btnPreviousPage",
1111, 738, 93, 62,
previousPageButtonCropArea,
normalStateImage,
PPage,
PreviousPageButton_Click
);
@ -1247,58 +1375,65 @@ namespace DualScreenDemo
btnReturn = new Button{ Text = "" };
btnReturn.Name = "btnReturn";
ResizeAndPositionButton(btnReturn, 1218, 755, 92, 57);
Rectangle returnButtonCropArea = new Rectangle(1218, 755, 92, 57);
btnReturn.BackgroundImage = normalStateImage.Clone(returnButtonCropArea, normalStateImage.PixelFormat);
ResizeAndPositionButton(btnReturn, 1220, 738, 93, 62);
Rectangle returnButtonCropArea = new Rectangle(1220, 738, 93, 62);
//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.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;
this.Controls.Add(btnReturn);
Rectangle nextPageButtonCropArea = new Rectangle(1326, 754, 92, 58);
Bitmap NPage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png"));
Rectangle nextPageButtonCropArea = new Rectangle(1330, 738, 93, 62);
InitializeButton(
ref btnNextPage,
"btnNextPage",
1326, 754, 92, 58,
nextPageButtonCropArea,
normalStateImage,
1330, 738, 93, 62,
nextPageButtonCropArea,
NPage,
NextPageButton_Click
);
Rectangle applauseButtonCropArea = new Rectangle(1110, 828, 91, 55);
Bitmap aPPaulse = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png"));
Rectangle applauseButtonCropArea = new Rectangle(1110, 823, 93, 62);
InitializeButton(
ref btnApplause,
"btnApplause",
1110, 828, 91, 55,
applauseButtonCropArea,
normalStateImage,
1110, 823, 93, 62,
applauseButtonCropArea,
aPPaulse,
ApplauseButton_Click
);
Rectangle simplifiedChineseButtonCropArea = new Rectangle(1327, 828, 90, 55);
Bitmap SChinese = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png"));
Rectangle simplifiedChineseButtonCropArea = new Rectangle(1330, 823, 93, 62);
InitializeButton(
ref btnSimplifiedChinese,
"btnSimplifiedChinese",
1327, 828, 90, 55,
simplifiedChineseButtonCropArea,
normalStateImage,
1330, 823, 93, 62,
simplifiedChineseButtonCropArea,
SChinese,
SimplifiedChineseButton_Click
);
Rectangle traditionalChineseButtonCropArea = new Rectangle(1219, 828, 90, 55);
Bitmap bTChinese = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png"));
Rectangle traditionalChineseButtonCropArea = new Rectangle(1220, 823, 93, 62);
InitializeButton(
ref btnTraditionalChinese,
"btnTraditionalChinese",
1219, 828, 90, 55,
traditionalChineseButtonCropArea,
normalStateImage,
1220, 823, 93, 62,
traditionalChineseButtonCropArea,
bTChinese,
TraditionalChineseButton_Click
);
@ -1339,10 +1474,14 @@ namespace DualScreenDemo
{
button = new Button { Text = "", Name = buttonName };
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.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0;
//button.FlatAppearance.MouseOverBackColor = Color.Transparent;
//button.FlatAppearance.MouseDownBackColor = Color.Transparent;
if (clickEventHandler != null)
{
button.Click += clickEventHandler;
@ -1471,81 +1610,81 @@ namespace DualScreenDemo
int targetWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
try
{
string imagePath = Path.Combine(Application.StartupPath, "themes\\superstar\\555019.jpg");
string imagePath = Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\選單內介面_同步畫面.jpg");
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);
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);
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);
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);
}
@ -1718,7 +1857,7 @@ namespace DualScreenDemo
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodActiveBackground;
deliciousFoodButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_美味菜單(已按).png"));
isOnOrderedSongsPage = false;
SetHotSongButtonsVisibility(false);
@ -2050,7 +2189,7 @@ namespace DualScreenDemo
Image = LoadButtonImage("服務鈴.png"),
Cursor = System.Windows.Forms.Cursors.Hand,
};
// 添加服務鈴點擊事件
serviceBellPictureBox.Click += (sender, e) => {
if (serviceBellButton != null)
@ -2091,7 +2230,7 @@ namespace DualScreenDemo
Image = null, //LoadButtonImage("星.png")
Cursor = System.Windows.Forms.Cursors.Hand
};
// 設定按鈕的初始位置和大小
UpdateSendOffButtonPositions();
@ -2151,8 +2290,10 @@ namespace DualScreenDemo
buttonThanks.Size = new Size((int)(150 * scaleX), (int)(150 * 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((int)(757 * scaleX), (int)(151 * scaleY));
serviceBellPictureBox.Location = new Point(740,103);
//serviceBellPictureBox.Size = new Size((int)(410 * scaleX), (int)(130 * scaleY));
serviceBellPictureBox.Size = new Size(430,146);
}
/// <summary>
@ -2210,14 +2351,14 @@ namespace DualScreenDemo
{
try
{
string filePath = Path.Combine(Application.StartupPath, "themes\\superstar\\VOD_送客畫面.jpg");
string filePath = Path.Combine(Application.StartupPath, "themes\\superstar\\主畫面\\選單內介面_送客畫面.jpg");
if (File.Exists(filePath))
{
return Image.FromFile(filePath);
}
else
{
Console.WriteLine("VOD_送客畫面.jpg 文件未找到。");
Console.WriteLine("選單內介面_送客畫面.jpg 文件未找到。");
return null;
}
}
@ -2260,7 +2401,7 @@ namespace DualScreenDemo
languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsActiveBackground;
orderedSongsButton.BackgroundImage = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\1.主類別\\主類別上方_已點歌曲(已按).png"));
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
@ -2296,5 +2437,33 @@ namespace DualScreenDemo
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
{
private TableLayoutPanel BopomofoSearch;
private PictureBox pictureBoxZhuYinSingers;
private Button[] phoneticButtonsForSingers;
@ -48,7 +50,7 @@ namespace DualScreenDemo
// 載入設定檔,取得圖片路徑資訊
var configData = LoadConfigData();
// 取得「注音歌手圖片」的完整路徑
string imagePath = Path.Combine(Application.StartupPath, configData["ImagePaths"]["ZhuYinSingers"]);
@ -63,7 +65,7 @@ namespace DualScreenDemo
SetZhuYinSingersAndButtonsVisibility(true); // 顯示注音搜尋相關控件
//SetPictureBoxArtistSearchAndButtonsVisibility(false); // 隱藏其他搜尋模式的圖片框
ResetinputBox(); // 重置輸入框
// 顯示「注音歌手搜尋」的圖片框
@ -71,6 +73,7 @@ namespace DualScreenDemo
}
/// <summary>
/// <para>從 config.ini 設定檔中載入注音符號Phonetic Symbols。</para>
/// <para>讀取 ini 檔的 [PhoneticSymbols] 區塊並將「Symbols」欄位的值解析為陣列。</para>
@ -524,7 +527,7 @@ namespace DualScreenDemo
private void FindZhuYiSingers(){
string searchText = inputBoxZhuYinSingers.Text;
string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM artists LIMIT 50;"
? "SELECT * FROM artists LIMIT 1000;"
: $"SELECT * FROM artists WHERE `phonetic_abbr` LIKE '{searchText}%';";
//string query = $"SELECT * FROM ArtistLibrary WHERE `歌手注音` LIKE '{searchText}%' ";
var searchResults = SearchSingers_Mysql(query);

View File

@ -274,7 +274,7 @@ namespace DualScreenDemo
private void FindEnglishSingers(){
string searchText = inputBoxEnglishSingers.Text;
string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM artists LIMIT 50;"
? "SELECT * FROM artists LIMIT 1000;"
: $"SELECT * FROM artists WHERE `name` LIKE '%{searchText}%';";
//string query = $"SELECT * FROM ArtistLibrary WHERE `歌手姓名` LIKE '{searchText}%' ";
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),
Visible = false
};
ResizeAndPositionControl(candidateListBoxForSingers, 350 + 679, 448, 115, 260);
ResizeAndPositionControl(candidateListBoxForSingers, 347 + 679, 448, 115, 270);
candidateListBoxForSingers.SelectedIndexChanged += CandidateListBoxForSingers_SelectedIndexChanged;
this.Controls.Add(candidateListBoxForSingers);
}
@ -290,7 +290,7 @@ namespace DualScreenDemo
private void FindHandwritingSingers(){
string searchText = handwritingInputBoxForSingers.Text;
string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM artists LIMIT 50;"
? "SELECT * FROM artists LIMIT 1000;"
: $"SELECT * FROM artists WHERE `name` LIKE '{searchText}%';";
//string query = $"SELECT * FROM ArtistLibrary WHERE `歌手姓名` LIKE '{searchText}%' ";
var searchResults = SearchSingers_Mysql(query);

View File

@ -176,7 +176,7 @@ namespace DualScreenDemo
// 在這裡添加搜尋歌曲的邏輯
// 例如:根據輸入框的內容搜尋歌曲
string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM artists; LIMIT 50"
? "SELECT * FROM artists; LIMIT 1000"
: $"SELECT * FROM artists WHERE `pinyin_abbr` 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 clearButtonWordCountSingers;
private Button closeButtonWordCountSingers;
private Button enterButtonWordCountSingers;
private string[] numberWordCountSymbols;
private (int X, int Y, int Width, int Height)[] numberWordCountButtonCoords;
@ -42,7 +43,8 @@ namespace DualScreenDemo
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) closeButtonWordCountCoords;
private (int X, int Y, int Width, int Height) enterButtonWordCountCoords;
private RichTextBox inputBoxWordCountSingers;
private (int X, int Y, int Width, int Height) inputBoxWordCountCoords;
@ -414,6 +416,9 @@ namespace DualScreenDemo
// 初始化關閉按鈕
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>
/// 「關閉」按鈕的點擊事件處理方法。
@ -534,10 +560,11 @@ namespace DualScreenDemo
// 隱藏 WordCount 歌手圖片框
pictureBoxWordCountSingers.Visible = false;
wordCountSearchButton.BackgroundImage = wordCountSearchNormalBackground;
FindWordCountSingers();
// 隱藏與 WordCount 歌手相關的所有按鈕
SetWordCountSingersAndButtonsVisibility(false);
}
private void FindWordCountSingers(){
string searchText = inputBoxWordCountSingers.Text; // 取得輸入內容
if (int.TryParse(searchText, out int length))
@ -814,6 +841,17 @@ namespace DualScreenDemo
if (isVisible) inputBoxWordCountSingers.BringToFront(); // 如果顯示,將其置於最前
}
// 檢查並設置enter按鈕的可見性
if (enterButtonWordCountSingers == null)
{
Console.WriteLine("enterButtonWordCountSingers is null");
}
else
{
enterButtonWordCountSingers.Visible = isVisible;
if (isVisible) enterButtonWordCountSingers.BringToFront(); // 如果顯示,將其置於最前
}
// 恢復控制項的佈局重新排版
ResumeLayout();
PerformLayout();
@ -830,6 +868,7 @@ namespace DualScreenDemo
modifyButtonWordCountSingers?.Refresh();
clearButtonWordCountSingers?.Refresh();
closeButtonWordCountSingers?.Refresh();
enterButtonWordCountSingers?.Refresh();
inputBoxWordCountSingers?.Refresh();
}
catch (Exception ex)

View File

@ -1,31 +1,34 @@
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm
{
private Button zhuyinSearchButton;
private Bitmap zhuyinSearchNormalBackground;
private Bitmap zhuyinSearchActiveBackground;
private Bitmap zhuyinSearchNormalBackground =new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_注音查詢(未按).png"));
private Bitmap zhuyinSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_注音查詢(已按).png"));
private Button englishSearchButton;
private Bitmap englishSearchNormalBackground;
private Bitmap englishSearchActiveBackground;
private Bitmap englishSearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_英文查詢(未按).png"));
private Bitmap englishSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_英文查詢(已按).png"));
private Button pinyinSearchButton;
private Bitmap pinyinSearchNormalBackground;
private Bitmap pinyinSearchActiveBackground;
private Bitmap pinyinSearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_拼音查詢(未按).png"));
private Bitmap pinyinSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_拼音查詢(已按).png"));
private Button wordCountSearchButton;
private Bitmap wordCountSearchNormalBackground;
private Bitmap wordCountSearchActiveBackground;
private Bitmap wordCountSearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_字數查詢(未按).png"));
private Bitmap wordCountSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_字數查詢(已按).png"));
private Button handWritingSearchButton;
private Bitmap handWritingSearchNormalBackground;
private Bitmap handWritingSearchActiveBackground;
private Bitmap handWritingSearchNormalBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_手寫查詢(未按).png"));
private Bitmap handWritingSearchActiveBackground = new Bitmap(Path.Combine(Application.StartupPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_手寫查詢(已按).png"));
private void SingerSearchButton_Click(object sender, EventArgs e)
{
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground;
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;
languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground;
@ -37,7 +40,7 @@ namespace DualScreenDemo
isOnOrderedSongsPage = false;
/* 清空搜尋欄 */
ResetinputBox();
string query = $"SELECT * FROM artists WHERE category = '男' LIMIT 100 ;";
string query = $"SELECT * FROM artists WHERE category = '男' LIMIT 1000 ;";
var searchResult = SearchSingers_Mysql(query);
currentPage = 0;
currentArtistList = searchResult;
@ -88,17 +91,17 @@ namespace DualScreenDemo
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)
@ -106,8 +109,8 @@ namespace DualScreenDemo
button = new Button { Text = "", Visible = true, Name = name };
ResizeAndPositionButton(button, x, y, width, height);
Rectangle buttonCropArea = new Rectangle(x, y, width, height);
normalBackground = normalImage.Clone(buttonCropArea, normalImage.PixelFormat);
activeBackground = activeImage.Clone(buttonCropArea, activeImage.PixelFormat);
//normalBackground = normalImage.Clone(buttonCropArea, normalImage.PixelFormat);
//activeBackground = activeImage.Clone(buttonCropArea, activeImage.PixelFormat);
button.BackgroundImage = normalBackground;
button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat;

View File

@ -311,7 +311,7 @@ namespace DualScreenDemo
// 例如:根據輸入框的內容搜尋歌曲
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`;";
var searchResults = SearchSongs_Mysql(query);

View File

@ -230,7 +230,7 @@ namespace DualScreenDemo
string searchText = inputBoxEnglishSongs.Text;
// 檢查是否為空字串或空白字元
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;";
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),
Visible = false
};
ResizeAndPositionControl(candidateListBoxForSongs, 350 + 679, 448, 115, 260);
ResizeAndPositionControl(candidateListBoxForSongs, 347 + 679, 448, 115, 270);
candidateListBoxForSongs.SelectedIndexChanged += CandidateListBoxForSongs_SelectedIndexChanged;
this.Controls.Add(candidateListBoxForSongs);
}
@ -287,7 +287,7 @@ namespace DualScreenDemo
// 在這裡添加搜尋歌曲的邏輯
// 例如:根據輸入框的內容搜尋歌曲
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;";

View File

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

View File

@ -266,7 +266,7 @@ namespace DualScreenDemo
// 在這裡添加搜尋歌曲的邏輯
// 例如:根據輸入框的內容搜尋歌曲
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;";
var searchResults = SearchSongs_Mysql(query);
// 重置分頁

View File

@ -14,7 +14,7 @@ namespace DualScreenDemo
private Button modifyButtonWordCountSongs;
private Button clearButtonWordCountSongs;
private Button closeButtonWordCountSongs;
private Button enterButtonWordCountSongs;
private RichTextBox inputBoxWordCountSongs;
@ -342,6 +342,9 @@ namespace DualScreenDemo
// 初始化關閉按鈕
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>
/// 「關閉」按鈕的點擊事件處理方法。
/// 隱藏 WordCount 歌手圖片框以及與其相關的按鈕。
@ -466,8 +491,14 @@ namespace DualScreenDemo
// 隱藏與 WordCount 歌手相關的所有按鈕
SetWordCountSongsAndButtonsVisibility(false);
// 歌曲查詢改版
}
private void EnterButtonWordCountSongs_Click(object sender, EventArgs e)
{
// 歌曲查詢改版
FindWordCountSongs();
}
/// <summary>
/// 查詢歌曲(字數查詢),連接資料庫並執行 SQL 查詢。
/// </summary>
@ -756,6 +787,16 @@ namespace DualScreenDemo
if (isVisible) inputBoxWordCountSongs.BringToFront(); // 如果顯示,將其置於最前
}
if (enterButtonWordCountSongs == null)
{
Console.WriteLine("enterButtonWordCountSongs is null");
}
else
{
enterButtonWordCountSongs.Visible = isVisible;
if (isVisible) enterButtonWordCountSongs.BringToFront(); // 如果顯示,將其置於最前
}
// 恢復控制項的佈局重新排版
ResumeLayout();
PerformLayout();
@ -772,6 +813,7 @@ namespace DualScreenDemo
modifyButtonWordCountSongs?.Refresh();
clearButtonWordCountSongs?.Refresh();
closeButtonWordCountSongs?.Refresh();
enterButtonWordCountSongs?.Refresh();
inputBoxWordCountSongs?.Refresh();
}
catch (Exception ex)

View File

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

1107
config.ini

File diff suppressed because it is too large Load Diff