2508281746
控制項從屬設定更正 程式碼重構/瘦身 Media載入流程調整,降低閃爍
This commit is contained in:
parent
ed34f6c05a
commit
04c10d23cb
@ -30,60 +30,60 @@ namespace DualScreenDemo
|
||||
{
|
||||
Name = "constructionButton",
|
||||
};
|
||||
ConfigureButton(constructionButton, 876, 494, 148, 64,
|
||||
ConfigureButton(constructionButton, 18, 68, 148, 64,
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["ConstruSite"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["ConstruSite"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["ConstruSite"])),
|
||||
ConstructionButton_Click);
|
||||
this.Controls.Add(constructionButton);
|
||||
pictureBoxSceneSoundEffects.Controls.Add(constructionButton);
|
||||
|
||||
|
||||
marketButton = new Button
|
||||
{
|
||||
Name = "marketButton",
|
||||
};
|
||||
ConfigureButton(marketButton, 1037, 495, 148, 63,
|
||||
ConfigureButton(marketButton, 179, 68, 148, 63,
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Market"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Market"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Market"])),
|
||||
MarketButton_Click);
|
||||
this.Controls.Add(marketButton);
|
||||
pictureBoxSceneSoundEffects.Controls.Add(marketButton);
|
||||
|
||||
|
||||
drivingButton = new Button
|
||||
{
|
||||
Name = "drivingButton",
|
||||
};
|
||||
ConfigureButton(drivingButton, 876, 570, 148, 63,
|
||||
ConfigureButton(drivingButton, 18, 144, 148, 63,
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Drive"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Drive"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Drive"])),
|
||||
DrivingButton_Click);
|
||||
this.Controls.Add(drivingButton);
|
||||
pictureBoxSceneSoundEffects.Controls.Add(drivingButton);
|
||||
|
||||
|
||||
airportButton = new Button
|
||||
{
|
||||
Name = "airportButton",
|
||||
};
|
||||
ConfigureButton(airportButton, 1037, 570, 148, 63,
|
||||
ConfigureButton(airportButton, 179, 144, 148, 63,
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Airport"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Airport"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Airport"])),
|
||||
AirportButton_Click);
|
||||
this.Controls.Add(airportButton);
|
||||
pictureBoxSceneSoundEffects.Controls.Add(airportButton);
|
||||
|
||||
|
||||
officeButton = new Button
|
||||
{
|
||||
Name = "officeButton",
|
||||
};
|
||||
ConfigureButton(officeButton, 876, 646, 148, 64,
|
||||
ConfigureButton(officeButton, 18, 220, 148, 64,
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Office"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Office"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Office"])),
|
||||
OfficeButton_Click);
|
||||
this.Controls.Add(officeButton);
|
||||
pictureBoxSceneSoundEffects.Controls.Add(officeButton);
|
||||
|
||||
|
||||
closeButton = new Button
|
||||
@ -91,22 +91,19 @@ namespace DualScreenDemo
|
||||
Name = "closeButton",
|
||||
};
|
||||
|
||||
ConfigureButton(closeButton, 1036, 646, 150, 63,
|
||||
ConfigureButton(closeButton, 179, 220, 150, 63,
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Close"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Close"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["SoundEffect"]["Close"])),
|
||||
CloseButton_Click);
|
||||
this.Controls.Add(closeButton);
|
||||
pictureBoxSceneSoundEffects.Controls.Add(closeButton);
|
||||
}
|
||||
|
||||
private void SoundEffectButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
SetHotSongButtonsVisibility(false);
|
||||
SetNewSongButtonsVisibility(false);
|
||||
SetSingerSearchButtonsVisibility(false);
|
||||
SetSongSearchButtonsVisibility(false);
|
||||
SetPictureBoxToggleLightAndButtonsVisibility(false);
|
||||
CloseUI(pictureBoxQRCode);
|
||||
|
||||
if (!pictureBoxSceneSoundEffects.Visible)
|
||||
{
|
||||
@ -151,19 +148,12 @@ namespace DualScreenDemo
|
||||
|
||||
private void ShowImageOnPictureBoxSceneSoundEffects(string imagePath)
|
||||
{
|
||||
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
|
||||
Rectangle cropArea = new Rectangle(859, 427, 342, 295);
|
||||
|
||||
|
||||
Bitmap croppedImage = CropImage(originalImage, cropArea);
|
||||
|
||||
Rectangle cropArea = new Rectangle(856, 422, 342, 295);
|
||||
|
||||
pictureBoxSceneSoundEffects.Image = originalImage;
|
||||
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxSceneSoundEffects, cropArea.X, cropArea.Y, cropArea.Width, cropArea.Height);
|
||||
|
||||
pictureBoxSceneSoundEffects.Visible = true;
|
||||
@ -171,44 +161,18 @@ namespace DualScreenDemo
|
||||
|
||||
private void TogglePictureBoxSceneSoundEffectsButtonsVisibility()
|
||||
{
|
||||
|
||||
bool areButtonsVisible = pictureBoxSceneSoundEffects.Visible;
|
||||
|
||||
|
||||
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(!areButtonsVisible);
|
||||
}
|
||||
|
||||
|
||||
private void SetPictureBoxSceneSoundEffectsAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
|
||||
pictureBoxSceneSoundEffects.Visible = isVisible;
|
||||
|
||||
if (isVisible)
|
||||
{
|
||||
|
||||
pictureBoxSceneSoundEffects.BringToFront();
|
||||
}
|
||||
|
||||
|
||||
List<Button> soundEffectButtons = new List<Button>
|
||||
{
|
||||
constructionButton,
|
||||
marketButton,
|
||||
drivingButton,
|
||||
airportButton,
|
||||
officeButton,
|
||||
closeButton
|
||||
};
|
||||
|
||||
|
||||
foreach (Button button in soundEffectButtons)
|
||||
{
|
||||
button.Visible = isVisible;
|
||||
if (isVisible)
|
||||
{
|
||||
button.BringToFront();
|
||||
}
|
||||
SetUIVisible(pictureBoxSceneSoundEffects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -239,20 +239,16 @@ namespace DualScreenDemo
|
||||
|
||||
private void ToggleLightButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
//SetHotSongButtonsVisibility(false);
|
||||
//SetNewSongButtonsVisibility(false);
|
||||
//SetSingerSearchButtonsVisibility(false);
|
||||
//SetSongSearchButtonsVisibility(false);
|
||||
|
||||
CloseUI(pictureBoxSceneSoundEffects);
|
||||
CloseUI(pictureBoxQRCode);
|
||||
|
||||
if (!pictureBoxToggleLight.Visible)
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
pictureBoxToggleLight.Size = new Size(630, 379);
|
||||
pictureBoxToggleLight.Location = new Point(570, 359);
|
||||
ResizeAndPositionPictureBox(pictureBoxToggleLight, 570, 359, 570, 359);
|
||||
pictureBoxToggleLight.Location = new Point(628, 359);
|
||||
ResizeAndPositionPictureBox(pictureBoxToggleLight, 628, 359, 570, 359);
|
||||
pictureBoxToggleLight.BackgroundImage = new Bitmap(Path.Combine(serverPath, data["LightControl"]["LightControlBaseUI"]));
|
||||
pictureBoxToggleLight.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
pictureBoxToggleLight.BringToFront();
|
||||
@ -273,50 +269,9 @@ namespace DualScreenDemo
|
||||
|
||||
private void SetPictureBoxToggleLightAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
|
||||
pictureBoxToggleLight.Visible = isVisible;
|
||||
|
||||
|
||||
btnTurnOn.Visible = isVisible;
|
||||
//btnTurnOff.Visible = isVisible;
|
||||
btnBright.Visible = isVisible;
|
||||
btnRomantic.Visible = isVisible;
|
||||
btnAuto.Visible = isVisible;
|
||||
btnColorTuning.Visible = isVisible;
|
||||
btnSoft.Visible = isVisible;
|
||||
btnDynamic.Visible = isVisible;
|
||||
btnDeskLamp.Visible = isVisible;
|
||||
btnStageLight.Visible = isVisible;
|
||||
btnShelfLight.Visible = isVisible;
|
||||
btnWallLight.Visible = isVisible;
|
||||
btnBrightnessUp1.Visible = isVisible;
|
||||
btnBrightnessDown1.Visible = isVisible;
|
||||
btnBrightnessUp2.Visible = isVisible;
|
||||
btnBrightnessDown2.Visible = isVisible;
|
||||
|
||||
if (isVisible)
|
||||
{
|
||||
|
||||
pictureBoxToggleLight.BringToFront();
|
||||
|
||||
|
||||
btnTurnOn.BringToFront();
|
||||
//btnTurnOff.BringToFront();
|
||||
btnBright.BringToFront();
|
||||
btnRomantic.BringToFront();
|
||||
btnAuto.BringToFront();
|
||||
btnColorTuning.BringToFront();
|
||||
btnSoft.BringToFront();
|
||||
btnDynamic.BringToFront();
|
||||
btnDeskLamp.BringToFront();
|
||||
btnStageLight.BringToFront();
|
||||
btnShelfLight.BringToFront();
|
||||
btnWallLight.BringToFront();
|
||||
btnBrightnessUp1.BringToFront();
|
||||
btnBrightnessDown1.BringToFront();
|
||||
btnBrightnessUp2.BringToFront();
|
||||
btnBrightnessDown2.BringToFront();
|
||||
}
|
||||
if (isVisible) SetUIVisible(pictureBoxToggleLight);
|
||||
else CloseUI(pictureBoxToggleLight);
|
||||
}
|
||||
}
|
||||
}
|
@ -1816,19 +1816,8 @@ namespace DualScreenDemo
|
||||
|
||||
private void MobileSongRequestButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetHotSongButtonsVisibility(false);
|
||||
SetNewSongButtonsVisibility(false);
|
||||
SetSingerSearchButtonsVisibility(false);
|
||||
SetSongSearchButtonsVisibility(false);
|
||||
SetPictureBoxLanguageButtonsVisibility(false);
|
||||
SetZhuYinSingersAndButtonsVisibility(false);
|
||||
SetZhuYinSongsAndButtonsVisibility(false);
|
||||
SetEnglishSingersAndButtonsVisibility(false);
|
||||
SetEnglishSongsAndButtonsVisibility(false);
|
||||
SetPinYinSingersAndButtonsVisibility(false);
|
||||
SetPinYinSongsAndButtonsVisibility(false);
|
||||
SetGroupButtonsVisibility(false);
|
||||
|
||||
CloseUI(pictureBoxSceneSoundEffects);
|
||||
SetPictureBoxToggleLightAndButtonsVisibility(false);
|
||||
|
||||
if (pictureBoxQRCode != null)
|
||||
{
|
||||
@ -2208,11 +2197,7 @@ namespace DualScreenDemo
|
||||
serviceBellPictureBox.Size = new Size(430, 146);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 送客畫面包廂名稱顯示
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
// 送客畫面包廂名稱顯示
|
||||
private void SendOffPanel_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
Size designSize = new Size(1920, 1080);
|
||||
@ -2257,10 +2242,7 @@ namespace DualScreenDemo
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加載送客畫面圖片
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
// 加載送客畫面圖片
|
||||
private Image LoadSendOffImage()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
@ -6,15 +6,169 @@ namespace DualScreenDemo
|
||||
public partial class PrimaryForm
|
||||
{
|
||||
private PictureBox pictureBoxHandWritingSingers;
|
||||
|
||||
private Button refillButtonHandWritingSingers;
|
||||
private Button clearButtonHandWritingSingers;
|
||||
private Button closeButtonForSingers;
|
||||
private Panel handWritingPanelForSingers;
|
||||
private InkOverlay inkOverlayForSingers;
|
||||
private RichTextBox handwritingInputBoxForSingers;
|
||||
private ListBox candidateListBoxForSingers;
|
||||
|
||||
private (int X, int Y, int Width, int Height) refillButtonHandWritingCoords;
|
||||
private (int X, int Y, int Width, int Height) clearButtonHandWritingCoords;
|
||||
private (int X, int Y, int Width, int Height) closeButtonHandWritingCoords;
|
||||
|
||||
private void InitializeHandWritingForSingers()
|
||||
{
|
||||
InitializeHandWritingPanelForSingers();
|
||||
InitializeInkOverlayForSingers();
|
||||
InitializeHandwritingInputBoxForSingers();
|
||||
InitializeCandidateListBoxForSingers();
|
||||
InitializeBtnsHandwritingSingers();
|
||||
}
|
||||
|
||||
private void InitializeHandWritingPanelForSingers()
|
||||
{
|
||||
handWritingPanelForSingers = new Panel
|
||||
{
|
||||
BorderStyle = BorderStyle.FixedSingle,
|
||||
BackColor = Color.WhiteSmoke,
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(handWritingPanelForSingers, 20, 89, 650, 260);
|
||||
|
||||
pictureBoxHandWritingSingers.Controls.Add(handWritingPanelForSingers);
|
||||
}
|
||||
|
||||
private void InitializeInkOverlayForSingers()
|
||||
{
|
||||
try
|
||||
{
|
||||
inkOverlayForSingers = new InkOverlay(handWritingPanelForSingers);
|
||||
inkOverlayForSingers.Enabled = false;
|
||||
inkOverlayForSingers.Ink = new Ink();
|
||||
inkOverlayForSingers.DefaultDrawingAttributes.Color = Color.Black;
|
||||
inkOverlayForSingers.DefaultDrawingAttributes.Width = 100;
|
||||
inkOverlayForSingers.Stroke += new InkCollectorStrokeEventHandler(InkOverlayForSingers_Stroke);
|
||||
|
||||
inkOverlayForSingers.Enabled = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Failed to initialize ink overlay for singers: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void InkOverlayForSingers_Stroke(object sender, InkCollectorStrokeEventArgs e)
|
||||
{
|
||||
|
||||
RecognizeInk(inkOverlayForSingers, candidateListBoxForSingers);
|
||||
}
|
||||
|
||||
private void InitializeHandwritingInputBoxForSingers()
|
||||
{
|
||||
|
||||
handwritingInputBoxForSingers = new RichTextBox
|
||||
{
|
||||
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(handwritingInputBoxForSingers, 20, 12, 541, 64);
|
||||
pictureBoxHandWritingSingers.Controls.Add(handwritingInputBoxForSingers);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void InitializeCandidateListBoxForSingers()
|
||||
{
|
||||
|
||||
candidateListBoxForSingers = new ListBox
|
||||
{
|
||||
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(candidateListBoxForSingers, 675, 81, 115, 270);
|
||||
candidateListBoxForSingers.SelectedIndexChanged += CandidateListBoxForSingers_SelectedIndexChanged;
|
||||
pictureBoxHandWritingSingers.Controls.Add(candidateListBoxForSingers);
|
||||
}
|
||||
|
||||
private void CandidateListBoxForSingers_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (candidateListBoxForSingers.SelectedIndex != -1)
|
||||
{
|
||||
string selectedWord = candidateListBoxForSingers.SelectedItem.ToString();
|
||||
handwritingInputBoxForSingers.Text += selectedWord;
|
||||
candidateListBoxForSingers.Visible = false;
|
||||
|
||||
|
||||
if (inkOverlayForSingers != null)
|
||||
{
|
||||
inkOverlayForSingers.Ink.DeleteStrokes();
|
||||
handWritingPanelForSingers.Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowImageOnPictureBoxHandWritingSingers(string imagePath)
|
||||
{
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
pictureBoxHandWritingSingers.Image = originalImage;
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxHandWritingSingers, 388, 355, 810, 360);
|
||||
|
||||
pictureBoxHandWritingSingers.Visible = true;
|
||||
}
|
||||
|
||||
private void SetHandWritingForSingersAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
EnableDoubleBuffering(handWritingPanelForSingers);
|
||||
EnableDoubleBuffering(handwritingInputBoxForSingers);
|
||||
EnableDoubleBuffering(candidateListBoxForSingers);
|
||||
EnableDoubleBuffering(pictureBoxHandWritingSingers);
|
||||
EnableDoubleBuffering(refillButtonHandWritingSingers);
|
||||
EnableDoubleBuffering(clearButtonHandWritingSingers);
|
||||
EnableDoubleBuffering(closeButtonForSingers);
|
||||
|
||||
if (isVisible)SetUIVisible(pictureBoxHandWritingSingers);
|
||||
else CloseUI(pictureBoxHandWritingSingers);
|
||||
}
|
||||
private void InitializeBtnsHandwritingSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
refillButtonHandWritingSingers = new Button
|
||||
{
|
||||
Name = "refillButtonHandWritingSingers",
|
||||
};
|
||||
ConfigureButton(refillButtonHandWritingSingers, 565, 12, 72, 66,
|
||||
new Bitmap(Path.Combine(serverPath, data["RefillButtonImagesHandWriting"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["RefillButtonImagesHandWriting"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["RefillButtonImagesHandWriting"]["mouseDown"])),
|
||||
RefillButtonHandWritingSingers_Click);
|
||||
pictureBoxHandWritingSingers.Controls.Add(refillButtonHandWritingSingers);
|
||||
|
||||
clearButtonHandWritingSingers = new Button
|
||||
{
|
||||
Name = "clearButtonHandWritingSongs",
|
||||
};
|
||||
ConfigureButton(clearButtonHandWritingSingers, 642, 11, 72, 66,
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesHandWriting"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesHandWriting"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesHandWriting"]["mouseDown"])),
|
||||
ClearButtonHandWritingSingers_Click);
|
||||
pictureBoxHandWritingSingers.Controls.Add(clearButtonHandWritingSingers);
|
||||
|
||||
|
||||
closeButtonForSingers = new Button
|
||||
{
|
||||
Name = "closeButtonForSingers",
|
||||
};
|
||||
ConfigureButton(closeButtonForSingers, 719, 11, 72, 66,
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesHandWriting"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesHandWriting"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesHandWriting"]["mouseDown"])),
|
||||
CloseButtonForSingers_Click);
|
||||
pictureBoxHandWritingSingers.Controls.Add(closeButtonForSingers);
|
||||
}
|
||||
#region 按鈕點擊事件
|
||||
private void HandWritingSearchButtonForSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SuspendLayout();
|
||||
@ -43,210 +197,11 @@ namespace DualScreenDemo
|
||||
ResetinputBox();
|
||||
this.ResumeLayout();
|
||||
}
|
||||
|
||||
private Panel handWritingPanelForSingers;
|
||||
private InkOverlay inkOverlayForSingers;
|
||||
private RichTextBox handwritingInputBoxForSingers;
|
||||
private ListBox candidateListBoxForSingers;
|
||||
|
||||
|
||||
private void InitializeHandWritingForSingers()
|
||||
{
|
||||
InitializeHandWritingPanelForSingers();
|
||||
InitializeInkOverlayForSingers();
|
||||
InitializeHandwritingInputBoxForSingers();
|
||||
InitializeCandidateListBoxForSingers();
|
||||
InitializeSpecialButtonsForHandWritingSingers();
|
||||
}
|
||||
|
||||
private void InitializeHandWritingPanelForSingers()
|
||||
{
|
||||
|
||||
handWritingPanelForSingers = new Panel
|
||||
{
|
||||
BorderStyle = BorderStyle.FixedSingle,
|
||||
Visible = false
|
||||
};
|
||||
|
||||
|
||||
ResizeAndPositionControl(handWritingPanelForSingers, 366, 448, 650, 260);
|
||||
|
||||
|
||||
this.Controls.Add(handWritingPanelForSingers);
|
||||
}
|
||||
|
||||
private void InitializeInkOverlayForSingers()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
inkOverlayForSingers = new InkOverlay(handWritingPanelForSingers);
|
||||
inkOverlayForSingers.Enabled = false;
|
||||
inkOverlayForSingers.Ink = new Ink();
|
||||
inkOverlayForSingers.DefaultDrawingAttributes.Color = Color.Black;
|
||||
inkOverlayForSingers.DefaultDrawingAttributes.Width = 100;
|
||||
inkOverlayForSingers.Stroke += new InkCollectorStrokeEventHandler(InkOverlayForSingers_Stroke);
|
||||
|
||||
|
||||
inkOverlayForSingers.Enabled = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Failed to initialize ink overlay for singers: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void InkOverlayForSingers_Stroke(object sender, InkCollectorStrokeEventArgs e)
|
||||
{
|
||||
|
||||
RecognizeInk(inkOverlayForSingers, candidateListBoxForSingers);
|
||||
}
|
||||
|
||||
private void InitializeHandwritingInputBoxForSingers()
|
||||
{
|
||||
|
||||
handwritingInputBoxForSingers = new RichTextBox
|
||||
{
|
||||
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(handwritingInputBoxForSingers, 366, 373, 541, 62);
|
||||
this.Controls.Add(handwritingInputBoxForSingers);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void InitializeCandidateListBoxForSingers()
|
||||
{
|
||||
|
||||
candidateListBoxForSingers = new ListBox
|
||||
{
|
||||
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(candidateListBoxForSingers, 347 + 679, 448, 115, 270);
|
||||
candidateListBoxForSingers.SelectedIndexChanged += CandidateListBoxForSingers_SelectedIndexChanged;
|
||||
this.Controls.Add(candidateListBoxForSingers);
|
||||
}
|
||||
|
||||
private void CandidateListBoxForSingers_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (candidateListBoxForSingers.SelectedIndex != -1)
|
||||
{
|
||||
string selectedWord = candidateListBoxForSingers.SelectedItem.ToString();
|
||||
handwritingInputBoxForSingers.Text += selectedWord;
|
||||
candidateListBoxForSingers.Visible = false;
|
||||
|
||||
|
||||
if (inkOverlayForSingers != null)
|
||||
{
|
||||
inkOverlayForSingers.Ink.DeleteStrokes();
|
||||
handWritingPanelForSingers.Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowImageOnPictureBoxHandWritingSingers(string imagePath)
|
||||
{
|
||||
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
|
||||
Rectangle displayArea = new Rectangle(350, 360, 810, 360);
|
||||
|
||||
|
||||
pictureBoxHandWritingSingers.Image = originalImage;
|
||||
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxHandWritingSingers, displayArea.X, displayArea.Y, displayArea.Width, displayArea.Height);
|
||||
|
||||
pictureBoxHandWritingSingers.Visible = true;
|
||||
}
|
||||
|
||||
private void SetHandWritingForSingersAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
|
||||
EnableDoubleBuffering(handWritingPanelForSingers);
|
||||
EnableDoubleBuffering(handwritingInputBoxForSingers);
|
||||
EnableDoubleBuffering(candidateListBoxForSingers);
|
||||
EnableDoubleBuffering(pictureBoxHandWritingSingers);
|
||||
EnableDoubleBuffering(refillButtonHandWritingSingers);
|
||||
EnableDoubleBuffering(clearButtonHandWritingSingers);
|
||||
EnableDoubleBuffering(closeButtonForSingers);
|
||||
|
||||
|
||||
handWritingPanelForSingers.Visible = isVisible;
|
||||
handwritingInputBoxForSingers.Visible = isVisible;
|
||||
inkOverlayForSingers.Enabled = isVisible;
|
||||
candidateListBoxForSingers.Visible = isVisible;
|
||||
pictureBoxHandWritingSingers.Visible = isVisible;
|
||||
refillButtonHandWritingSingers.Visible = isVisible;
|
||||
clearButtonHandWritingSingers.Visible = isVisible;
|
||||
closeButtonForSingers.Visible = isVisible;
|
||||
|
||||
if (isVisible)
|
||||
{
|
||||
|
||||
pictureBoxHandWritingSingers.BringToFront();
|
||||
handWritingPanelForSingers.BringToFront();
|
||||
handwritingInputBoxForSingers.BringToFront();
|
||||
candidateListBoxForSingers.BringToFront();
|
||||
refillButtonHandWritingSingers.BringToFront();
|
||||
clearButtonHandWritingSingers.BringToFront();
|
||||
closeButtonForSingers.BringToFront();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeSpecialButtonsForHandWritingSingers()
|
||||
{
|
||||
|
||||
InitializeRefillButtonHandwritingSingers();
|
||||
|
||||
|
||||
InitializeClearButtonHandWritingSingers();
|
||||
|
||||
|
||||
InitializeCloseButtonForSingers();
|
||||
}
|
||||
|
||||
private void InitializeRefillButtonHandwritingSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
refillButtonHandWritingCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "refillButtonHandWritingSingers");
|
||||
var buttonImages = LoadButtonImages(data, "RefillButtonImagesHandWriting");
|
||||
|
||||
refillButtonHandWritingSingers = CreateSpecialButton(
|
||||
"refillButtonHandWritingSingers",
|
||||
refillButtonHandWritingCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
RefillButtonHandWritingSingers_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void RefillButtonHandWritingSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
handwritingInputBoxForSingers.Text = "";
|
||||
}
|
||||
|
||||
private void InitializeClearButtonHandWritingSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
clearButtonHandWritingCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "clearButtonHandWritingSingers");
|
||||
var buttonImages = LoadButtonImages(data, "ClearButtonImagesHandWriting");
|
||||
|
||||
clearButtonHandWritingSingers = CreateSpecialButton(
|
||||
"clearButtonHandWritingSingers",
|
||||
clearButtonHandWritingCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
|
||||
ClearButtonHandWritingSingers_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void ClearButtonHandWritingSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Controls.Contains(handWritingPanelForSingers) && inkOverlayForSingers != null)
|
||||
@ -255,23 +210,6 @@ namespace DualScreenDemo
|
||||
handWritingPanelForSingers.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeCloseButtonForSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
closeButtonHandWritingCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "closeButtonForSingers");
|
||||
var buttonImages = LoadButtonImages(data, "CloseButtonImagesHandWriting");
|
||||
|
||||
closeButtonForSingers = CreateSpecialButton(
|
||||
"closeButtonForSingers",
|
||||
closeButtonHandWritingCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
CloseButtonForSingers_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void CloseButtonForSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -282,7 +220,8 @@ namespace DualScreenDemo
|
||||
FindHandwritingSingers();
|
||||
this.ResumeLayout();
|
||||
}
|
||||
private void FindHandwritingSingers(){
|
||||
private void FindHandwritingSingers()
|
||||
{
|
||||
string searchText = handwritingInputBoxForSingers.Text;
|
||||
string query = string.IsNullOrWhiteSpace(searchText)
|
||||
? "SELECT * FROM artists LIMIT 1000;"
|
||||
@ -297,5 +236,6 @@ namespace DualScreenDemo
|
||||
multiPagePanel.currentPageIndex = 0;
|
||||
multiPagePanel.LoadSingers(currentArtistList);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -6,11 +6,167 @@ namespace DualScreenDemo
|
||||
public partial class PrimaryForm
|
||||
{
|
||||
private PictureBox pictureBoxHandWritingSongs;
|
||||
|
||||
private Button refillButtonHandWritingSongs;
|
||||
private Button clearButtonHandWritingSongs;
|
||||
private Button closeButtonForSongs;
|
||||
private Panel handWritingPanelForSongs;
|
||||
private InkOverlay inkOverlayForSongs;
|
||||
private RichTextBox handwritingInputBoxForSongs;
|
||||
private ListBox candidateListBoxForSongs;
|
||||
|
||||
private void InitializeHandWritingForSongs()
|
||||
{
|
||||
InitializeHandWritingPanelForSongs();
|
||||
InitializeInkOverlayForSongs();
|
||||
InitializeHandwritingInputBoxForSongs();
|
||||
InitializeCandidateListBoxForSongs();
|
||||
InitializeBtnsHandwritingSongs();
|
||||
}
|
||||
|
||||
private void InitializeHandWritingPanelForSongs()
|
||||
{
|
||||
handWritingPanelForSongs = new Panel
|
||||
{
|
||||
BorderStyle = BorderStyle.FixedSingle,
|
||||
BackColor = Color.WhiteSmoke,
|
||||
Visible = false
|
||||
};
|
||||
|
||||
ResizeAndPositionControl(handWritingPanelForSongs, 20, 89, 650, 260);
|
||||
|
||||
pictureBoxHandWritingSongs.Controls.Add(handWritingPanelForSongs);
|
||||
}
|
||||
|
||||
private void InitializeInkOverlayForSongs()
|
||||
{
|
||||
try
|
||||
{
|
||||
inkOverlayForSongs = new InkOverlay(handWritingPanelForSongs);
|
||||
inkOverlayForSongs.Enabled = false;
|
||||
inkOverlayForSongs.Ink = new Ink();
|
||||
inkOverlayForSongs.DefaultDrawingAttributes.Color = Color.Black;
|
||||
inkOverlayForSongs.DefaultDrawingAttributes.Width = 100;
|
||||
inkOverlayForSongs.Stroke += new InkCollectorStrokeEventHandler(InkOverlayForSongs_Stroke);
|
||||
inkOverlayForSongs.Enabled = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Failed to initialize ink overlay for singers: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void InkOverlayForSongs_Stroke(object sender, InkCollectorStrokeEventArgs e)
|
||||
{
|
||||
|
||||
RecognizeInk(inkOverlayForSongs, candidateListBoxForSongs);
|
||||
}
|
||||
|
||||
private void InitializeHandwritingInputBoxForSongs()
|
||||
{
|
||||
|
||||
handwritingInputBoxForSongs = new RichTextBox
|
||||
{
|
||||
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(handwritingInputBoxForSongs, 20, 12, 541, 64);
|
||||
pictureBoxHandWritingSongs.Controls.Add(handwritingInputBoxForSongs);
|
||||
}
|
||||
|
||||
private void InitializeCandidateListBoxForSongs()
|
||||
{
|
||||
|
||||
candidateListBoxForSongs = new ListBox
|
||||
{
|
||||
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(candidateListBoxForSongs, 675, 81, 115, 270);
|
||||
candidateListBoxForSongs.SelectedIndexChanged += CandidateListBoxForSongs_SelectedIndexChanged;
|
||||
pictureBoxHandWritingSongs.Controls.Add(candidateListBoxForSongs);
|
||||
}
|
||||
|
||||
private void CandidateListBoxForSongs_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (candidateListBoxForSongs.SelectedIndex != -1)
|
||||
{
|
||||
string selectedWord = candidateListBoxForSongs.SelectedItem.ToString();
|
||||
handwritingInputBoxForSongs.Text += selectedWord;
|
||||
candidateListBoxForSongs.Visible = false;
|
||||
|
||||
|
||||
if (inkOverlayForSongs != null)
|
||||
{
|
||||
inkOverlayForSongs.Ink.DeleteStrokes();
|
||||
handWritingPanelForSongs.Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowImageOnPictureBoxHandWritingSongs(string imagePath)
|
||||
{
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
pictureBoxHandWritingSongs.Image = originalImage;
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxHandWritingSongs, 388, 355, 810, 360);
|
||||
|
||||
pictureBoxHandWritingSongs.Visible = true;
|
||||
}
|
||||
|
||||
private void SetHandWritingForSongsAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
EnableDoubleBuffering(handWritingPanelForSongs);
|
||||
EnableDoubleBuffering(handwritingInputBoxForSongs);
|
||||
EnableDoubleBuffering(candidateListBoxForSongs);
|
||||
EnableDoubleBuffering(pictureBoxHandWritingSongs);
|
||||
EnableDoubleBuffering(refillButtonHandWritingSongs);
|
||||
EnableDoubleBuffering(clearButtonHandWritingSongs);
|
||||
EnableDoubleBuffering(closeButtonForSongs);
|
||||
|
||||
if (isVisible)SetUIVisible(pictureBoxHandWritingSongs);
|
||||
else CloseUI(pictureBoxHandWritingSongs);
|
||||
}
|
||||
|
||||
private void InitializeBtnsHandwritingSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
refillButtonHandWritingSongs = new Button
|
||||
{
|
||||
Name = "refillButtonHandWritingSongs",
|
||||
};
|
||||
ConfigureButton(refillButtonHandWritingSongs, 565, 12, 72, 66,
|
||||
new Bitmap(Path.Combine(serverPath, data["RefillButtonImagesHandWriting"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["RefillButtonImagesHandWriting"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["RefillButtonImagesHandWriting"]["mouseDown"])),
|
||||
RefillButtonHandWritingSongs_Click);
|
||||
pictureBoxHandWritingSongs.Controls.Add(refillButtonHandWritingSongs);
|
||||
|
||||
clearButtonHandWritingSongs = new Button
|
||||
{
|
||||
Name = "clearButtonHandWritingSongs",
|
||||
};
|
||||
ConfigureButton(clearButtonHandWritingSongs, 642, 11, 72, 66,
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesHandWriting"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesHandWriting"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesHandWriting"]["mouseDown"])),
|
||||
ClearButtonHandWritingSongs_Click);
|
||||
pictureBoxHandWritingSongs.Controls.Add(clearButtonHandWritingSongs);
|
||||
|
||||
|
||||
closeButtonForSongs = new Button
|
||||
{
|
||||
Name = "closeButtonForSongs",
|
||||
};
|
||||
ConfigureButton(closeButtonForSongs, 719, 11, 72, 66,
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesHandWriting"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesHandWriting"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesHandWriting"]["mouseDown"])),
|
||||
CloseButtonForSongs_Click);
|
||||
pictureBoxHandWritingSongs.Controls.Add(closeButtonForSongs);
|
||||
}
|
||||
#region 按鈕點擊事件
|
||||
private void HandWritingSearchButtonForSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SuspendLayout();
|
||||
@ -48,206 +204,10 @@ namespace DualScreenDemo
|
||||
this.ResumeLayout();
|
||||
}
|
||||
|
||||
private Panel handWritingPanelForSongs;
|
||||
private InkOverlay inkOverlayForSongs;
|
||||
private RichTextBox handwritingInputBoxForSongs;
|
||||
private ListBox candidateListBoxForSongs;
|
||||
|
||||
|
||||
private void InitializeHandWritingForSongs()
|
||||
{
|
||||
InitializeHandWritingPanelForSongs();
|
||||
InitializeInkOverlayForSongs();
|
||||
InitializeHandwritingInputBoxForSongs();
|
||||
InitializeCandidateListBoxForSongs();
|
||||
InitializeSpecialButtonsForHandWritingSongs();
|
||||
}
|
||||
|
||||
private void InitializeHandWritingPanelForSongs()
|
||||
{
|
||||
|
||||
handWritingPanelForSongs = new Panel
|
||||
{
|
||||
BorderStyle = BorderStyle.FixedSingle,
|
||||
Visible = false
|
||||
};
|
||||
|
||||
|
||||
ResizeAndPositionControl(handWritingPanelForSongs, 366, 448, 650, 260);
|
||||
|
||||
|
||||
this.Controls.Add(handWritingPanelForSongs);
|
||||
}
|
||||
|
||||
private void InitializeInkOverlayForSongs()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
inkOverlayForSongs = new InkOverlay(handWritingPanelForSongs);
|
||||
inkOverlayForSongs.Enabled = false;
|
||||
inkOverlayForSongs.Ink = new Ink();
|
||||
inkOverlayForSongs.DefaultDrawingAttributes.Color = Color.Black;
|
||||
inkOverlayForSongs.DefaultDrawingAttributes.Width = 100;
|
||||
inkOverlayForSongs.Stroke += new InkCollectorStrokeEventHandler(InkOverlayForSongs_Stroke);
|
||||
|
||||
|
||||
inkOverlayForSongs.Enabled = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Failed to initialize ink overlay for singers: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void InkOverlayForSongs_Stroke(object sender, InkCollectorStrokeEventArgs e)
|
||||
{
|
||||
|
||||
RecognizeInk(inkOverlayForSongs, candidateListBoxForSongs);
|
||||
}
|
||||
|
||||
private void InitializeHandwritingInputBoxForSongs()
|
||||
{
|
||||
|
||||
handwritingInputBoxForSongs = new RichTextBox
|
||||
{
|
||||
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(handwritingInputBoxForSongs, 366, 373, 541, 62);
|
||||
this.Controls.Add(handwritingInputBoxForSongs);
|
||||
}
|
||||
|
||||
private void InitializeCandidateListBoxForSongs()
|
||||
{
|
||||
|
||||
candidateListBoxForSongs = new ListBox
|
||||
{
|
||||
Font = new Font("微軟正黑體", (float)26 / 900 * Screen.PrimaryScreen.Bounds.Height, FontStyle.Regular),
|
||||
Visible = false
|
||||
};
|
||||
ResizeAndPositionControl(candidateListBoxForSongs, 347 + 679, 448, 115, 270);
|
||||
candidateListBoxForSongs.SelectedIndexChanged += CandidateListBoxForSongs_SelectedIndexChanged;
|
||||
this.Controls.Add(candidateListBoxForSongs);
|
||||
}
|
||||
|
||||
private void CandidateListBoxForSongs_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (candidateListBoxForSongs.SelectedIndex != -1)
|
||||
{
|
||||
string selectedWord = candidateListBoxForSongs.SelectedItem.ToString();
|
||||
handwritingInputBoxForSongs.Text += selectedWord;
|
||||
candidateListBoxForSongs.Visible = false;
|
||||
|
||||
|
||||
if (inkOverlayForSongs != null)
|
||||
{
|
||||
inkOverlayForSongs.Ink.DeleteStrokes();
|
||||
handWritingPanelForSongs.Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowImageOnPictureBoxHandWritingSongs(string imagePath)
|
||||
{
|
||||
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
|
||||
Rectangle displayArea = new Rectangle(350, 360, 810, 360);
|
||||
|
||||
|
||||
pictureBoxHandWritingSongs.Image = originalImage;
|
||||
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxHandWritingSongs, displayArea.X, displayArea.Y, displayArea.Width, displayArea.Height);
|
||||
|
||||
pictureBoxHandWritingSongs.Visible = true;
|
||||
}
|
||||
|
||||
private void SetHandWritingForSongsAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
|
||||
EnableDoubleBuffering(handWritingPanelForSongs);
|
||||
EnableDoubleBuffering(handwritingInputBoxForSongs);
|
||||
EnableDoubleBuffering(candidateListBoxForSongs);
|
||||
EnableDoubleBuffering(pictureBoxHandWritingSongs);
|
||||
EnableDoubleBuffering(refillButtonHandWritingSongs);
|
||||
EnableDoubleBuffering(clearButtonHandWritingSongs);
|
||||
EnableDoubleBuffering(closeButtonForSongs);
|
||||
|
||||
|
||||
handWritingPanelForSongs.Visible = isVisible;
|
||||
handwritingInputBoxForSongs.Visible = isVisible;
|
||||
inkOverlayForSongs.Enabled = isVisible;
|
||||
candidateListBoxForSongs.Visible = isVisible;
|
||||
pictureBoxHandWritingSongs.Visible = isVisible;
|
||||
refillButtonHandWritingSongs.Visible = isVisible;
|
||||
clearButtonHandWritingSongs.Visible = isVisible;
|
||||
closeButtonForSongs.Visible = isVisible;
|
||||
|
||||
if (isVisible)
|
||||
{
|
||||
|
||||
pictureBoxHandWritingSongs.BringToFront();
|
||||
handWritingPanelForSongs.BringToFront();
|
||||
handwritingInputBoxForSongs.BringToFront();
|
||||
candidateListBoxForSongs.BringToFront();
|
||||
refillButtonHandWritingSongs.BringToFront();
|
||||
clearButtonHandWritingSongs.BringToFront();
|
||||
closeButtonForSongs.BringToFront();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeSpecialButtonsForHandWritingSongs()
|
||||
{
|
||||
|
||||
InitializeRefillButtonHandwritingSongs();
|
||||
|
||||
|
||||
InitializeClearButtonHandWritingSongs();
|
||||
|
||||
|
||||
InitializeCloseButtonForSongs();
|
||||
}
|
||||
|
||||
private void InitializeRefillButtonHandwritingSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
refillButtonHandWritingCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "refillButtonHandWritingSongs");
|
||||
var buttonImages = LoadButtonImages(data, "RefillButtonImagesHandWriting");
|
||||
|
||||
refillButtonHandWritingSongs = CreateSpecialButton(
|
||||
"refillButtonHandWritingSongs",
|
||||
refillButtonHandWritingCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
RefillButtonHandWritingSongs_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void RefillButtonHandWritingSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
handwritingInputBoxForSongs.Text = "";
|
||||
}
|
||||
|
||||
private void InitializeClearButtonHandWritingSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
clearButtonHandWritingCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "clearButtonHandWritingSongs");
|
||||
var buttonImages = LoadButtonImages(data, "ClearButtonImagesHandWriting");
|
||||
|
||||
clearButtonHandWritingSongs = CreateSpecialButton(
|
||||
"clearButtonHandWritingSongs",
|
||||
clearButtonHandWritingCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
ClearButtonHandWritingSongs_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void ClearButtonHandWritingSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Controls.Contains(handWritingPanelForSongs) && inkOverlayForSongs != null)
|
||||
@ -256,23 +216,6 @@ namespace DualScreenDemo
|
||||
handWritingPanelForSongs.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeCloseButtonForSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
closeButtonHandWritingCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "closeButtonForSongs");
|
||||
var buttonImages = LoadButtonImages(data, "CloseButtonImagesHandWriting");
|
||||
|
||||
closeButtonForSongs = CreateSpecialButton(
|
||||
"closeButtonForSongs",
|
||||
closeButtonHandWritingCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
CloseButtonForSongs_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void CloseButtonForSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -282,7 +225,8 @@ namespace DualScreenDemo
|
||||
FindHandwritingSongs();
|
||||
this.ResumeLayout();
|
||||
}
|
||||
private void FindHandwritingSongs(){
|
||||
private void FindHandwritingSongs()
|
||||
{
|
||||
string searchText = handwritingInputBoxForSongs.Text;
|
||||
// 在這裡添加搜尋歌曲的邏輯
|
||||
// 例如:根據輸入框的內容搜尋歌曲
|
||||
@ -290,7 +234,6 @@ namespace DualScreenDemo
|
||||
? "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_name DESC;";
|
||||
|
||||
|
||||
var searchResults = SearchSongs_Mysql(query);
|
||||
// 重置分頁
|
||||
currentPage = 0;
|
||||
@ -298,8 +241,7 @@ namespace DualScreenDemo
|
||||
// 更新多頁面面板的內容
|
||||
multiPagePanel.currentPageIndex = 0;
|
||||
multiPagePanel.LoadSongs(searchResults);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -84,7 +84,8 @@ namespace DualScreenDemo.Services
|
||||
_mediaPlayer.Stop();
|
||||
_media?.Dispose();
|
||||
_media = new Media(filePath, FromType.FromPath);
|
||||
_mediaPlayer.Play(addMediaOption(_media, audioTrackIndex));
|
||||
_mediaPlayer.Media = addMediaOption(_media, audioTrackIndex);
|
||||
_mediaPlayer.Play();
|
||||
_mediaPlayer.Fullscreen=true;
|
||||
_mediaPlayer.Mute = false;
|
||||
// _mediaPlayer.Stopped += (s, e) => Console.WriteLine("Player Stopped");
|
||||
|
42
img.ini
42
img.ini
@ -478,18 +478,12 @@ closeButtonEnglishSingers = 1110,633,70,66
|
||||
modifyButtonPinYinSingers = 1032,612,70,84
|
||||
clearButtonPinYinSingers = 408,612,70,84
|
||||
closeButtonPinYinSingers = 1110,612,70,84
|
||||
refillButtonHandWritingSingers = 916,372,70,65
|
||||
clearButtonHandWritingSingers = 993,372,70,65
|
||||
closeButtonForSingers = 1070,372,70,65
|
||||
modifyButtonEnglishSongs = 1032,633,70,66
|
||||
clearButtonEnglishSongs = 408,633,70,66
|
||||
closeButtonEnglishSongs = 1110,633,70,66
|
||||
modifyButtonPinYinSongs = 1032,612,70,84
|
||||
clearButtonPinYinSongs = 408,612,70,84
|
||||
closeButtonPinYinSongs = 1110,612,70,84
|
||||
refillButtonHandWritingSongs = 916,372,70,65
|
||||
clearButtonHandWritingSongs = 993,372,70,65
|
||||
closeButtonForSongs = 1070,372,70,65
|
||||
modifyButtonWordCountSongs = 926,624,72,67
|
||||
clearButtonWordCountSongs = 845,624,72,67
|
||||
enterButtonWordCountSongs=1007,624,72,67
|
||||
@ -991,37 +985,6 @@ FontSize = 26
|
||||
FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
[PictureBoxWordCountSongs]
|
||||
X = 790
|
||||
Y = 350
|
||||
Width = 420
|
||||
Height = 350
|
||||
|
||||
[InputBoxWordCountSongs]
|
||||
X = 800
|
||||
Y = 405
|
||||
Width = 400
|
||||
Height = 60
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
[NumberWordCountSymbols]
|
||||
Symbols=1,2,3,4,5,6,7,8,9,0
|
||||
|
||||
[NumberWordCountButtonCoordinates]
|
||||
button0 = 650,420,70,65
|
||||
button1 = 804,474,72,67
|
||||
button2 = 886,474,72,67
|
||||
button3 = 965,474,73,67
|
||||
button4 = 1048,474,72,67
|
||||
button5 = 1129,474,72,67
|
||||
button6 = 804,548,72,67
|
||||
button7 = 886,548,72,67
|
||||
button8 = 965,548,73,67
|
||||
button9 = 1048,548,72,67
|
||||
button10 = 1129,548,72,67
|
||||
|
||||
[NumberWordCountButtonImages]
|
||||
button0_normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(字數按鍵)_1.png
|
||||
@ -1055,12 +1018,13 @@ button9_normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名
|
||||
button9_mouseDown = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(字數按鍵)_0 複本.png
|
||||
button9_mouseOver = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(字數按鍵)_0.png
|
||||
|
||||
[ModifyButtonImagesWordCount]
|
||||
|
||||
[ClearButtonImagesWordCount]
|
||||
normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_清除.png
|
||||
mouseOver = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_清除.png
|
||||
mouseDown = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_清除 複本.png
|
||||
|
||||
[ClearButtonImagesWordCount]
|
||||
[ModifyButtonImagesWordCount]
|
||||
normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_重填.png
|
||||
mouseOver = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_重填.png
|
||||
mouseDown = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_重填 複本.png
|
||||
|
Loading…
x
Reference in New Issue
Block a user