test #1
@ -1616,254 +1616,299 @@ private void DisplaySongsInLanguage(string language, Category category)
|
||||
public int totalSongs = 0;
|
||||
|
||||
|
||||
public void DisplaySongs(int page)
|
||||
{
|
||||
if (LanguageSongList == null || LanguageSongList.Count == 0)
|
||||
{
|
||||
Console.WriteLine("LanguageSongList is null or empty.");
|
||||
return;
|
||||
}
|
||||
public void DisplaySongs(int page)
|
||||
{
|
||||
// 檢查 LanguageSongList 是否為空,避免發生錯誤
|
||||
if (LanguageSongList == null || LanguageSongList.Count == 0)
|
||||
{
|
||||
Console.WriteLine("LanguageSongList is null or empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||
// 清除介面上所有 PictureBox 控件,避免重複顯示舊的內容
|
||||
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||
|
||||
int songsPerColumn = 5;
|
||||
int startIndex = (page - 1) * songsPerPage;
|
||||
int endIndex = Math.Min(startIndex + songsPerPage, LanguageSongList.Count);
|
||||
// 每列顯示 5 首歌
|
||||
int songsPerColumn = 5;
|
||||
|
||||
// 計算當前頁面的起始與結束索引
|
||||
int startIndex = (page - 1) * songsPerPage;
|
||||
int endIndex = Math.Min(startIndex + songsPerPage, LanguageSongList.Count);
|
||||
|
||||
int totalPages = (int)Math.Ceiling((double)LanguageSongList.Count / songsPerPage);
|
||||
// 計算總頁數
|
||||
int totalPages = (int)Math.Ceiling((double)LanguageSongList.Count / songsPerPage);
|
||||
|
||||
string categoryText = OverlayForm.CurrentCategory switch
|
||||
{
|
||||
OverlayForm.Category.NewSongs => "新歌",
|
||||
OverlayForm.Category.HotSongs => "熱門",
|
||||
_ => ""
|
||||
};
|
||||
string headerText = $"{currentLanguage} - {categoryText} ({page} / {totalPages})";
|
||||
Font headerFont = new Font("Microsoft JhengHei", 60, FontStyle.Bold);
|
||||
Bitmap headerBitmap = GenerateTextImage(headerText, headerFont, Color.White, Color.Transparent);
|
||||
AddCenteredPicture(headerBitmap, 150);
|
||||
// 根據當前分類選擇標題文字
|
||||
string categoryText = OverlayForm.CurrentCategory switch
|
||||
{
|
||||
OverlayForm.Category.NewSongs => "新歌",
|
||||
OverlayForm.Category.HotSongs => "熱門",
|
||||
_ => ""
|
||||
};
|
||||
|
||||
int startY = 250;
|
||||
int leftColumnX = 100;
|
||||
int rightColumnX = this.Width / 2 + 100;
|
||||
// 設定標題格式,包含語言、分類與當前頁碼
|
||||
string headerText = $"{currentLanguage} - {categoryText} ({page} / {totalPages})";
|
||||
|
||||
// 設定標題的字體樣式
|
||||
Font headerFont = new Font("Microsoft JhengHei", 60, FontStyle.Bold);
|
||||
|
||||
// 生成標題圖片
|
||||
Bitmap headerBitmap = GenerateTextImage(headerText, headerFont, Color.White, Color.Transparent);
|
||||
|
||||
// 顯示標題圖片,垂直置於 150px 處
|
||||
AddCenteredPicture(headerBitmap, 150);
|
||||
|
||||
// 計算當前頁面最大歌名和歌手文字長度
|
||||
int maxSongLength = 0;
|
||||
int maxArtistLength = 0;
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
string songText = $"{i - startIndex + 1}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
// 設定歌名顯示區域的起始 Y 位置
|
||||
int startY = 250;
|
||||
|
||||
// 左列與右列的 X 位置
|
||||
int leftColumnX = 100;
|
||||
int rightColumnX = this.Width / 2 + 100;
|
||||
|
||||
maxSongLength = Math.Max(maxSongLength, songText.Length);
|
||||
maxArtistLength = Math.Max(maxArtistLength, artistText.Length);
|
||||
}
|
||||
// 計算當前頁面最大歌名和歌手文字長度,決定適合的字體大小
|
||||
int maxSongLength = 0;
|
||||
int maxArtistLength = 0;
|
||||
|
||||
int songFontSize = maxSongLength > 20 ? 35 : 45;
|
||||
int artistFontSize = maxArtistLength > 20 ? 30 : 35;
|
||||
int verticalSpacing = songFontSize == 30 ? 25 : 10;
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
string songText = $"{i - startIndex + 1}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
|
||||
// 統一行高
|
||||
int rowHeight = 0;
|
||||
maxSongLength = Math.Max(maxSongLength, songText.Length);
|
||||
maxArtistLength = Math.Max(maxArtistLength, artistText.Length);
|
||||
}
|
||||
|
||||
// 計算行高
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
string songText = $"{i - startIndex + 1}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
// 根據最大字數決定適當的字體大小
|
||||
int songFontSize = maxSongLength > 20 ? 35 : 45;
|
||||
int artistFontSize = maxArtistLength > 20 ? 30 : 35;
|
||||
|
||||
// 設定歌曲行間距
|
||||
int verticalSpacing = songFontSize == 30 ? 25 : 10;
|
||||
|
||||
Font songFont = new Font("Microsoft JhengHei", songFontSize, FontStyle.Bold);
|
||||
Font artistFont = new Font("Microsoft JhengHei", artistFontSize, FontStyle.Bold);
|
||||
// 設定統一的行高
|
||||
int rowHeight = 0;
|
||||
|
||||
Bitmap songBitmap = GenerateTextImage(songText, songFont, Color.White, Color.Transparent);
|
||||
Bitmap artistBitmap = GenerateTextImage(artistText, artistFont, Color.White, Color.Transparent);
|
||||
// 計算行高
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
string songText = $"{i - startIndex + 1}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
|
||||
rowHeight = Math.Max(rowHeight, Math.Max(songBitmap.Height, artistBitmap.Height));
|
||||
}
|
||||
Font songFont = new Font("Microsoft JhengHei", songFontSize, FontStyle.Bold);
|
||||
Font artistFont = new Font("Microsoft JhengHei", artistFontSize, FontStyle.Bold);
|
||||
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
int songNumber = i - startIndex + 1;
|
||||
Bitmap songBitmap = GenerateTextImage(songText, songFont, Color.White, Color.Transparent);
|
||||
Bitmap artistBitmap = GenerateTextImage(artistText, artistFont, Color.White, Color.Transparent);
|
||||
|
||||
string songText = $"{songNumber}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
rowHeight = Math.Max(rowHeight, Math.Max(songBitmap.Height, artistBitmap.Height));
|
||||
}
|
||||
|
||||
Font songFont = new Font("Microsoft JhengHei", songFontSize, FontStyle.Bold);
|
||||
Font artistFont = new Font("Microsoft JhengHei", artistFontSize, FontStyle.Bold);
|
||||
// 依據計算出的行高,逐行顯示歌曲與歌手名稱
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
int songNumber = i - startIndex + 1;
|
||||
|
||||
Bitmap songBitmap = GenerateTextImage(songText, songFont, Color.White, Color.Transparent);
|
||||
Bitmap artistBitmap = GenerateTextImage(artistText, artistFont, Color.White, Color.Transparent);
|
||||
string songText = $"{songNumber}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
|
||||
int x = (i - startIndex) < songsPerColumn ? leftColumnX : rightColumnX;
|
||||
int y = startY + ((i - startIndex) % songsPerColumn) * (rowHeight + verticalSpacing);
|
||||
Font songFont = new Font("Microsoft JhengHei", songFontSize, FontStyle.Bold);
|
||||
Font artistFont = new Font("Microsoft JhengHei", artistFontSize, FontStyle.Bold);
|
||||
|
||||
AddPicture(songBitmap, x, y);
|
||||
AddPicture(artistBitmap, x + songBitmap.Width + 20, y);
|
||||
}
|
||||
}
|
||||
Bitmap songBitmap = GenerateTextImage(songText, songFont, Color.White, Color.Transparent);
|
||||
Bitmap artistBitmap = GenerateTextImage(artistText, artistFont, Color.White, Color.Transparent);
|
||||
|
||||
public void DisplaySongsWithArrows(int page, int highlightIndex)
|
||||
{
|
||||
if (LanguageSongList == null || LanguageSongList.Count == 0)
|
||||
{
|
||||
Console.WriteLine("Error: LanguageSongList is null or empty.");
|
||||
return;
|
||||
}
|
||||
// 根據索引決定左側或右側顯示
|
||||
int x = (i - startIndex) < songsPerColumn ? leftColumnX : rightColumnX;
|
||||
|
||||
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||
// 計算 Y 位置
|
||||
int y = startY + ((i - startIndex) % songsPerColumn) * (rowHeight + verticalSpacing);
|
||||
|
||||
int songsPerColumn = 5;
|
||||
int startIndex = (page - 1) * songsPerPage;
|
||||
int endIndex = Math.Min(startIndex + songsPerPage, LanguageSongList.Count);
|
||||
// 顯示歌曲名稱圖片
|
||||
AddPicture(songBitmap, x, y);
|
||||
|
||||
// 顯示歌手名稱圖片(稍微右移)
|
||||
AddPicture(artistBitmap, x + songBitmap.Width + 20, y);
|
||||
}
|
||||
}
|
||||
|
||||
int totalPages = (int)Math.Ceiling((double)LanguageSongList.Count / songsPerPage);
|
||||
|
||||
string categoryText = OverlayForm.CurrentCategory switch
|
||||
{
|
||||
OverlayForm.Category.NewSongs => "新歌",
|
||||
OverlayForm.Category.HotSongs => "熱門",
|
||||
_ => ""
|
||||
};
|
||||
public void DisplaySongsWithArrows(int page, int highlightIndex)
|
||||
{
|
||||
// 檢查 LanguageSongList 是否為空,避免發生錯誤
|
||||
if (LanguageSongList == null || LanguageSongList.Count == 0)
|
||||
{
|
||||
Console.WriteLine("Error: LanguageSongList is null or empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
string headerText = $"{currentLanguage} - {categoryText} ({page} / {totalPages})";
|
||||
Font headerFont = new Font("Microsoft JhengHei", 60, FontStyle.Bold);
|
||||
Bitmap headerBitmap = GenerateTextImage(headerText, headerFont, Color.White, Color.Transparent);
|
||||
AddCenteredPicture(headerBitmap, 150);
|
||||
// 清除介面上所有 PictureBox 控件,避免重複顯示舊的內容
|
||||
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||
|
||||
int startY = 250;
|
||||
int leftColumnX = 100;
|
||||
int rightColumnX = this.Width / 2 + 100;
|
||||
// 每列顯示 5 首歌
|
||||
int songsPerColumn = 5;
|
||||
// 計算當前頁面的起始與結束索引
|
||||
int startIndex = (page - 1) * songsPerPage;
|
||||
int endIndex = Math.Min(startIndex + songsPerPage, LanguageSongList.Count);
|
||||
|
||||
// 找到当前页面中最长的 songText 和 artistText 长度
|
||||
int maxSongLength = 0;
|
||||
int maxArtistLength = 0;
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
string songText = $"{i - startIndex + 1}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
// 計算總頁數
|
||||
int totalPages = (int)Math.Ceiling((double)LanguageSongList.Count / songsPerPage);
|
||||
|
||||
maxSongLength = Math.Max(maxSongLength, songText.Length);
|
||||
maxArtistLength = Math.Max(maxArtistLength, artistText.Length);
|
||||
}
|
||||
// 根據當前分類選擇標題文字
|
||||
string categoryText = OverlayForm.CurrentCategory switch
|
||||
{
|
||||
OverlayForm.Category.NewSongs => "新歌",
|
||||
OverlayForm.Category.HotSongs => "熱門",
|
||||
_ => ""
|
||||
};
|
||||
|
||||
// 动态调整字体大小
|
||||
int songFontSize = maxSongLength > 20 ? 35 : 45;
|
||||
int artistFontSize = maxArtistLength > 20 ? 30 : 35;
|
||||
int verticalSpacing = songFontSize == 30 ? 25 : 10;
|
||||
// 設定標題格式,包含語言、分類與當前頁碼
|
||||
string headerText = $"{currentLanguage} - {categoryText} ({page} / {totalPages})";
|
||||
// 設定標題的字體樣式
|
||||
Font headerFont = new Font("Microsoft JhengHei", 60, FontStyle.Bold);
|
||||
// 生成標題圖片
|
||||
Bitmap headerBitmap = GenerateTextImage(headerText, headerFont, Color.White, Color.Transparent);
|
||||
// 顯示標題圖片,垂直置於 150px 處
|
||||
AddCenteredPicture(headerBitmap, 150);
|
||||
|
||||
// 统一行高計算
|
||||
int rowHeight = 0;
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
string songText = $"{i - startIndex + 1}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
// 設定歌名顯示區域的起始 Y 位置
|
||||
int startY = 250;
|
||||
// 左列與右列的 X 位置
|
||||
int leftColumnX = 100;
|
||||
int rightColumnX = this.Width / 2 + 100;
|
||||
|
||||
Font tempSongFont = new Font("Microsoft JhengHei", songFontSize, FontStyle.Bold);
|
||||
Font tempArtistFont = new Font("Microsoft JhengHei", artistFontSize, FontStyle.Bold);
|
||||
// 找到當前頁面中最長的 songText 和 artistText 長度
|
||||
int maxSongLength = 0;
|
||||
int maxArtistLength = 0;
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
string songText = $"{i - startIndex + 1}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
|
||||
Bitmap tempSongBitmap = GenerateTextImage(songText, tempSongFont, Color.White, Color.Transparent);
|
||||
Bitmap tempArtistBitmap = GenerateTextImage(artistText, tempArtistFont, Color.White, Color.Transparent);
|
||||
maxSongLength = Math.Max(maxSongLength, songText.Length);
|
||||
maxArtistLength = Math.Max(maxArtistLength, artistText.Length);
|
||||
}
|
||||
|
||||
rowHeight = Math.Max(rowHeight, Math.Max(tempSongBitmap.Height, tempArtistBitmap.Height));
|
||||
}
|
||||
// 動態調整字體大小
|
||||
int songFontSize = maxSongLength > 20 ? 35 : 45;
|
||||
int artistFontSize = maxArtistLength > 20 ? 30 : 35;
|
||||
int verticalSpacing = songFontSize == 30 ? 25 : 10;
|
||||
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
int songNumber = i - startIndex + 1;
|
||||
// 統一行高計算
|
||||
int rowHeight = 0;
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
string songText = $"{i - startIndex + 1}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
|
||||
string songText = $"{songNumber}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
Font tempSongFont = new Font("Microsoft JhengHei", songFontSize, FontStyle.Bold);
|
||||
Font tempArtistFont = new Font("Microsoft JhengHei", artistFontSize, FontStyle.Bold);
|
||||
|
||||
// 设置颜色,选中的索引显示为亮绿色
|
||||
Color songColor = (i == highlightIndex) ? Color.LimeGreen : Color.White;
|
||||
Color artistColor = (i == highlightIndex) ? Color.LimeGreen : Color.White;
|
||||
Bitmap tempSongBitmap = GenerateTextImage(songText, tempSongFont, Color.White, Color.Transparent);
|
||||
Bitmap tempArtistBitmap = GenerateTextImage(artistText, tempArtistFont, Color.White, Color.Transparent);
|
||||
|
||||
Font songFont = new Font("Microsoft JhengHei", songFontSize, FontStyle.Bold);
|
||||
Bitmap songBitmap = GenerateTextImage(songText, songFont, songColor, Color.Transparent);
|
||||
rowHeight = Math.Max(rowHeight, Math.Max(tempSongBitmap.Height, tempArtistBitmap.Height));
|
||||
}
|
||||
|
||||
Font artistFont = new Font("Microsoft JhengHei", artistFontSize, FontStyle.Bold);
|
||||
Bitmap artistBitmap = GenerateTextImage(artistText, artistFont, artistColor, Color.Transparent);
|
||||
// 依據計算出的行高,逐行顯示歌曲與歌手名稱
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
int songNumber = i - startIndex + 1;
|
||||
|
||||
int x = (i - startIndex) < songsPerColumn ? leftColumnX : rightColumnX;
|
||||
int y = startY + ((i - startIndex) % songsPerColumn) * (rowHeight + verticalSpacing);
|
||||
string songText = $"{songNumber}. {LanguageSongList[i].Song}";
|
||||
string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
: LanguageSongList[i].ArtistA;
|
||||
|
||||
AddPicture(songBitmap, x, y);
|
||||
AddPicture(artistBitmap, x + songBitmap.Width + 20, y);
|
||||
}
|
||||
}
|
||||
// 設定顏色,選中的索引顯示為亮綠色
|
||||
Color songColor = (i == highlightIndex) ? Color.LimeGreen : Color.White;
|
||||
Color artistColor = (i == highlightIndex) ? Color.LimeGreen : Color.White;
|
||||
|
||||
Font songFont = new Font("Microsoft JhengHei", songFontSize, FontStyle.Bold);
|
||||
Bitmap songBitmap = GenerateTextImage(songText, songFont, songColor, Color.Transparent);
|
||||
|
||||
Font artistFont = new Font("Microsoft JhengHei", artistFontSize, FontStyle.Bold);
|
||||
Bitmap artistBitmap = GenerateTextImage(artistText, artistFont, artistColor, Color.Transparent);
|
||||
|
||||
int x = (i - startIndex) < songsPerColumn ? leftColumnX : rightColumnX;
|
||||
int y = startY + ((i - startIndex) % songsPerColumn) * (rowHeight + verticalSpacing);
|
||||
|
||||
// 顯示歌曲名稱圖片
|
||||
AddPicture(songBitmap, x, y);
|
||||
// 顯示歌手名稱圖片(稍微右移)
|
||||
AddPicture(artistBitmap, x + songBitmap.Width + 20, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void DisplayActionWithSong(int page, int songIndex, string actionType)
|
||||
{
|
||||
// try
|
||||
// {
|
||||
// if (LanguageSongList == null || LanguageSongList.Count == 0)
|
||||
// {
|
||||
// Console.WriteLine("Error: LanguageSongList is null or empty.");
|
||||
// return;
|
||||
// }
|
||||
public void DisplayActionWithSong(int page, int songIndex, string actionType)
|
||||
{
|
||||
// try
|
||||
// {
|
||||
// if (LanguageSongList == null || LanguageSongList.Count == 0)
|
||||
// {
|
||||
// Console.WriteLine("Error: LanguageSongList is null or empty.");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// SongData song = LanguageSongList[songIndex];
|
||||
// SongData song = LanguageSongList[songIndex];
|
||||
|
||||
// this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||
// this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||
|
||||
// int songsPerColumn = 5;
|
||||
// int startIndex = (page - 1) * songsPerPage;
|
||||
// int endIndex = Math.Min(startIndex + songsPerPage, LanguageSongList.Count);
|
||||
// int songsPerColumn = 5;
|
||||
// int startIndex = (page - 1) * songsPerPage;
|
||||
// int endIndex = Math.Min(startIndex + songsPerPage, LanguageSongList.Count);
|
||||
|
||||
// int totalPages = (int)Math.Ceiling((double)LanguageSongList.Count / songsPerPage);
|
||||
// int totalPages = (int)Math.Ceiling((double)LanguageSongList.Count / songsPerPage);
|
||||
|
||||
// string headerText = $"{actionType}: {song.ArtistA} - {song.Song} ({page} / {totalPages})";
|
||||
// Font headerFont = new Font("Microsoft JhengHei", 40, FontStyle.Bold);
|
||||
// Color headerColor = actionType == "點播" ? Color.LimeGreen : Color.Yellow;
|
||||
// Bitmap headerBitmap = GenerateTextImage(headerText, headerFont, headerColor, Color.Transparent);
|
||||
// AddCenteredPicture(headerBitmap, 150);
|
||||
// string headerText = $"{actionType}: {song.ArtistA} - {song.Song} ({page} / {totalPages})";
|
||||
// Font headerFont = new Font("Microsoft JhengHei", 40, FontStyle.Bold);
|
||||
// Color headerColor = actionType == "點播" ? Color.LimeGreen : Color.Yellow;
|
||||
// Bitmap headerBitmap = GenerateTextImage(headerText, headerFont, headerColor, Color.Transparent);
|
||||
// AddCenteredPicture(headerBitmap, 150);
|
||||
|
||||
// int startY = 250;
|
||||
// int verticalSpacing = 10;
|
||||
// int leftColumnX = 200;
|
||||
// int rightColumnX = this.Width / 2 + 150;
|
||||
// int startY = 250;
|
||||
// int verticalSpacing = 10;
|
||||
// int leftColumnX = 200;
|
||||
// int rightColumnX = this.Width / 2 + 150;
|
||||
|
||||
// for (int i = startIndex; i < endIndex; i++)
|
||||
// {
|
||||
// int songNumber = i - startIndex + 1;
|
||||
// string songText = $"{songNumber}. {LanguageSongList[i].Song}";
|
||||
// string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
// ? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
// : LanguageSongList[i].ArtistA;
|
||||
// for (int i = startIndex; i < endIndex; i++)
|
||||
// {
|
||||
// int songNumber = i - startIndex + 1;
|
||||
// string songText = $"{songNumber}. {LanguageSongList[i].Song}";
|
||||
// string artistText = !string.IsNullOrWhiteSpace(LanguageSongList[i].ArtistB)
|
||||
// ? $"{LanguageSongList[i].ArtistA} - {LanguageSongList[i].ArtistB}"
|
||||
// : LanguageSongList[i].ArtistA;
|
||||
|
||||
// Font songFont = new Font("Microsoft JhengHei", 40, FontStyle.Bold);
|
||||
// Bitmap songBitmap = GenerateTextImage(songText, songFont, Color.White, Color.Transparent);
|
||||
// Font songFont = new Font("Microsoft JhengHei", 40, FontStyle.Bold);
|
||||
// Bitmap songBitmap = GenerateTextImage(songText, songFont, Color.White, Color.Transparent);
|
||||
|
||||
// Font artistFont = new Font("Microsoft JhengHei", 30, FontStyle.Bold);
|
||||
// Bitmap artistBitmap = GenerateTextImage(artistText, artistFont, Color.White, Color.Transparent);
|
||||
// Font artistFont = new Font("Microsoft JhengHei", 30, FontStyle.Bold);
|
||||
// Bitmap artistBitmap = GenerateTextImage(artistText, artistFont, Color.White, Color.Transparent);
|
||||
|
||||
// int x = (i - startIndex) < songsPerColumn ? leftColumnX : rightColumnX;
|
||||
// int y = startY + ((i - startIndex) % songsPerColumn) * (songBitmap.Height + verticalSpacing);
|
||||
// int x = (i - startIndex) < songsPerColumn ? leftColumnX : rightColumnX;
|
||||
// int y = startY + ((i - startIndex) % songsPerColumn) * (songBitmap.Height + verticalSpacing);
|
||||
|
||||
// AddPicture(songBitmap, x, y);
|
||||
// AddPicture(artistBitmap, x + songBitmap.Width + 20, y);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Console.WriteLine($"Error in DisplayActionWithSong: {ex.Message}");
|
||||
// Console.WriteLine(ex.StackTrace);
|
||||
// }
|
||||
}
|
||||
// AddPicture(songBitmap, x, y);
|
||||
// AddPicture(artistBitmap, x + songBitmap.Width + 20, y);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Console.WriteLine($"Error in DisplayActionWithSong: {ex.Message}");
|
||||
// Console.WriteLine(ex.StackTrace);
|
||||
// }
|
||||
}
|
||||
|
||||
public void NextPage()
|
||||
{
|
||||
|
@ -7,9 +7,9 @@ ZhuYinSongs = themes\superstar\歌名\注音\VOD_歌名查詢_注音查詢(按
|
||||
EnglishSongs = themes\superstar\歌名\英文\VOD_歌名查詢_英文查詢(按鍵)_歌星查詢-注音查詢_未按.png
|
||||
PinYinSongs = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)_歌星查詢-注音查詢_未按.png
|
||||
HandWritingSongs = themes\superstar\歌星\手寫\3.歌星查詢(手寫按鍵)_未按.png
|
||||
WordCountSongs = themes\superstar\歌名\字數\VOD_歌名查詢_編號查詢(按鍵)_未按_沒有確認.png
|
||||
WordCountSingers = themes\superstar\歌星\字數\VOD_歌星查詢_編號查詢(按鍵)_未按_沒有確認.png
|
||||
SongIDSearch = themes\superstar\歌名\編號\VOD_歌名查詢_編號查詢(按鍵)_未按_沒有確認.png
|
||||
WordCountSongs = themes\superstar\歌名\字數\VOD_歌名查詢_編號查詢(按鍵)_未按.png
|
||||
WordCountSingers = themes\superstar\歌星\字數\VOD_歌星查詢_編號查詢(按鍵)_未按.png
|
||||
SongIDSearch = themes\superstar\歌名\編號\VOD_歌名查詢_編號查詢(按鍵)_未按.png
|
||||
|
||||
[PictureBoxZhuYinSingers]
|
||||
X = 130
|
||||
|
Reference in New Issue
Block a user