test #1

Merged
jasonchenwork merged 64 commits from test into master 2025-03-18 17:32:23 +08:00
2 changed files with 37 additions and 1 deletions
Showing only changes of commit 9258dfa068 - Show all commits

View File

@ -3474,13 +3474,21 @@ public class MultiPagePanel : Panel
sendOffPanel.Controls.Add(buttonTopLeft);
sendOffPanel.Controls.Add(buttonThanks);
// 包廂名稱顯示
sendOffPanel.Paint+=SendOffPanel_Paint;
// 確保圖片在最上層
serviceBellPictureBox.BringToFront(); // 確保服務鈴在最上層
buttonMiddle.BringToFront();
buttonTopRight.BringToFront();
buttonTopLeft.BringToFront();
buttonThanks.BringToFront();
sendOffPanel.Resize += (s, e) => UpdateSendOffButtonPositions();
// 重新計算按鈕位置
sendOffPanel.Resize += (s, e) => {
UpdateSendOffButtonPositions();
sendOffPanel.Invalidate(); // 重新繪製面板以更新顯示
};
this.Controls.Add(sendOffPanel);
}
/// <summary>
@ -3511,6 +3519,34 @@ public class MultiPagePanel : Panel
serviceBellPictureBox.Location = new Point((int)(757 * scaleX), (int)(151 * scaleY));
serviceBellPictureBox.Size = new Size((int)(410 * scaleX), (int)(130 * scaleY));
}
/// <summary>
/// 送客畫面包廂名稱顯示
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SendOffPanel_Paint(object sender, PaintEventArgs e)
{
Size designSize = new Size(1920, 1080);
var panelWidth = sendOffPanel.Width;
var panelHeight = sendOffPanel.Height;
// 計算寬高的縮放比例
float scaleX = panelWidth / (float)designSize.Width;
float scaleY = panelHeight / (float)designSize.Height;
float scaledFontSize = 84f * scaleY;
string hostName = System.Net.Dns.GetHostName();
string displayName = "包廂" + hostName.Substring(Math.Max(0, hostName.Length - 20));
using (Font font = new Font("微軟正黑體", scaledFontSize, FontStyle.Bold))
using (Brush brush = new SolidBrush(Color.Red))
{
PointF point_PCName = new PointF(820 * scaleX, 325 * scaleY);
e.Graphics.DrawString(displayName, font, brush, point_PCName);
}
}
// 添加載入按鈕圖片的方法
private Image LoadButtonImage(string imageName)

Binary file not shown.