From 332cc54cefe540791eda0b0d803311cea3faee6e Mon Sep 17 00:00:00 2001 From: Bob Long Date: Fri, 7 Jul 2023 01:52:00 -0400 Subject: [PATCH] OSDConfigurator: add support for HD layouts --- ExtLibs/OSDConfigurator/GUI/LayoutControl.cs | 20 +- .../GUI/ScreenControl.Designer.cs | 394 +++++++++--------- ExtLibs/OSDConfigurator/GUI/ScreenControl.cs | 27 +- .../OSDConfigurator/GUI/ScreenControl.resx | 238 +++++------ ExtLibs/OSDConfigurator/GUI/Visualizer.cs | 25 +- 5 files changed, 387 insertions(+), 317 deletions(-) diff --git a/ExtLibs/OSDConfigurator/GUI/LayoutControl.cs b/ExtLibs/OSDConfigurator/GUI/LayoutControl.cs index 6b7638ffc6..2617e780d5 100644 --- a/ExtLibs/OSDConfigurator/GUI/LayoutControl.cs +++ b/ExtLibs/OSDConfigurator/GUI/LayoutControl.cs @@ -44,6 +44,17 @@ public Size CharSize ReDraw(); } } + + public bool IsHighDef = false; + + public Size ScreenSize + { + set + { + Visualizer?.SetScreenSizeChar(value); + ReDraw(); + } + } public LayoutControl() { @@ -120,7 +131,14 @@ private void Draw(object sender, PaintEventArgs e) if (DesignMode) return; - Visualizer.DrawBackground(e.Graphics); + if(IsHighDef) + { + Visualizer.DrawHDBackground(e.Graphics); + } + else + { + Visualizer.DrawSDBackground(e.Graphics); + } if (items != null) { diff --git a/ExtLibs/OSDConfigurator/GUI/ScreenControl.Designer.cs b/ExtLibs/OSDConfigurator/GUI/ScreenControl.Designer.cs index e891bcb9e0..83d191fbf1 100644 --- a/ExtLibs/OSDConfigurator/GUI/ScreenControl.Designer.cs +++ b/ExtLibs/OSDConfigurator/GUI/ScreenControl.Designer.cs @@ -28,195 +28,208 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.panelItemList = new System.Windows.Forms.FlowLayoutPanel(); - this.groupScreenOptions = new System.Windows.Forms.GroupBox(); - this.tableRoot = new System.Windows.Forms.TableLayoutPanel(); - this.tableRight = new System.Windows.Forms.TableLayoutPanel(); - this.groupOptions = new System.Windows.Forms.GroupBox(); - this.grEditorOptions = new System.Windows.Forms.GroupBox(); - this.cbUseNameCaptions = new System.Windows.Forms.CheckBox(); - this.btnClearAll = new System.Windows.Forms.Button(); - this.btnPaste = new System.Windows.Forms.Button(); - this.btnCopy = new System.Windows.Forms.Button(); - this.cbReducedView = new System.Windows.Forms.CheckBox(); - this.tableLeft = new System.Windows.Forms.TableLayoutPanel(); - this.layoutControl = new OSDConfigurator.GUI.LayoutControl(); - this.tableRoot.SuspendLayout(); - this.tableRight.SuspendLayout(); - this.grEditorOptions.SuspendLayout(); - this.tableLeft.SuspendLayout(); - this.SuspendLayout(); - // - // panelItemList - // - this.panelItemList.AutoScroll = true; - this.panelItemList.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelItemList.Location = new System.Drawing.Point(3, 195); - this.panelItemList.MinimumSize = new System.Drawing.Size(50, 50); - this.panelItemList.Name = "panelItemList"; - this.panelItemList.Size = new System.Drawing.Size(405, 183); - this.panelItemList.TabIndex = 1; - // - // groupScreenOptions - // - this.groupScreenOptions.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupScreenOptions.Location = new System.Drawing.Point(3, 110); - this.groupScreenOptions.Name = "groupScreenOptions"; - this.groupScreenOptions.Size = new System.Drawing.Size(344, 131); - this.groupScreenOptions.TabIndex = 1; - this.groupScreenOptions.TabStop = false; - this.groupScreenOptions.Text = "Screen Options"; - // - // tableRoot - // - this.tableRoot.ColumnCount = 2; - this.tableRoot.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableRoot.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableRoot.Controls.Add(this.tableRight, 1, 0); - this.tableRoot.Controls.Add(this.tableLeft, 0, 0); - this.tableRoot.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableRoot.Location = new System.Drawing.Point(0, 0); - this.tableRoot.Name = "tableRoot"; - this.tableRoot.RowCount = 1; - this.tableRoot.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableRoot.Size = new System.Drawing.Size(773, 387); - this.tableRoot.TabIndex = 5; - // - // tableRight - // - this.tableRight.ColumnCount = 1; - this.tableRight.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableRight.Controls.Add(this.groupOptions, 0, 2); - this.tableRight.Controls.Add(this.groupScreenOptions, 0, 1); - this.tableRight.Controls.Add(this.grEditorOptions, 0, 0); - this.tableRight.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableRight.Location = new System.Drawing.Point(420, 3); - this.tableRight.MaximumSize = new System.Drawing.Size(400, 0); - this.tableRight.Name = "tableRight"; - this.tableRight.RowCount = 3; - this.tableRight.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableRight.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableRight.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableRight.Size = new System.Drawing.Size(350, 381); - this.tableRight.TabIndex = 0; - // - // groupOptions - // - this.groupOptions.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupOptions.Location = new System.Drawing.Point(3, 247); - this.groupOptions.Name = "groupOptions"; - this.groupOptions.Size = new System.Drawing.Size(344, 131); - this.groupOptions.TabIndex = 0; - this.groupOptions.TabStop = false; - this.groupOptions.Text = "Item Options"; - // - // grEditorOptions - // - this.grEditorOptions.Controls.Add(this.cbUseNameCaptions); - this.grEditorOptions.Controls.Add(this.btnClearAll); - this.grEditorOptions.Controls.Add(this.btnPaste); - this.grEditorOptions.Controls.Add(this.btnCopy); - this.grEditorOptions.Controls.Add(this.cbReducedView); - this.grEditorOptions.Dock = System.Windows.Forms.DockStyle.Top; - this.grEditorOptions.Location = new System.Drawing.Point(3, 3); - this.grEditorOptions.Name = "grEditorOptions"; - this.grEditorOptions.Size = new System.Drawing.Size(344, 101); - this.grEditorOptions.TabIndex = 2; - this.grEditorOptions.TabStop = false; - this.grEditorOptions.Text = "Editor Options"; - // - // cbUseNameCaptions - // - this.cbUseNameCaptions.AutoSize = true; - this.cbUseNameCaptions.Location = new System.Drawing.Point(23, 58); - this.cbUseNameCaptions.Name = "cbUseNameCaptions"; - this.cbUseNameCaptions.Size = new System.Drawing.Size(89, 17); - this.cbUseNameCaptions.TabIndex = 4; - this.cbUseNameCaptions.Text = "Show Names"; - this.cbUseNameCaptions.UseVisualStyleBackColor = true; - // - // btnClearAll - // - this.btnClearAll.Location = new System.Drawing.Point(127, 58); - this.btnClearAll.Name = "btnClearAll"; - this.btnClearAll.Size = new System.Drawing.Size(93, 33); - this.btnClearAll.TabIndex = 3; - this.btnClearAll.Text = "Clear All"; - this.btnClearAll.UseVisualStyleBackColor = true; - // - // btnPaste - // - this.btnPaste.Location = new System.Drawing.Point(226, 19); - this.btnPaste.Name = "btnPaste"; - this.btnPaste.Size = new System.Drawing.Size(93, 33); - this.btnPaste.TabIndex = 2; - this.btnPaste.Text = "Paste Layout"; - this.btnPaste.UseVisualStyleBackColor = true; - // - // btnCopy - // - this.btnCopy.Location = new System.Drawing.Point(127, 19); - this.btnCopy.Name = "btnCopy"; - this.btnCopy.Size = new System.Drawing.Size(93, 33); - this.btnCopy.TabIndex = 1; - this.btnCopy.Text = "Copy Layout"; - this.btnCopy.UseVisualStyleBackColor = true; - // - // cbReducedView - // - this.cbReducedView.AutoSize = true; - this.cbReducedView.Location = new System.Drawing.Point(23, 28); - this.cbReducedView.Name = "cbReducedView"; - this.cbReducedView.Size = new System.Drawing.Size(72, 17); - this.cbReducedView.TabIndex = 0; - this.cbReducedView.Text = "Decrease"; - this.cbReducedView.UseVisualStyleBackColor = true; - // - // tableLeft - // - this.tableLeft.AutoScroll = true; - this.tableLeft.AutoSize = true; - this.tableLeft.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLeft.ColumnCount = 1; - this.tableLeft.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLeft.Controls.Add(this.layoutControl, 0, 0); - this.tableLeft.Controls.Add(this.panelItemList, 0, 1); - this.tableLeft.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLeft.Location = new System.Drawing.Point(3, 3); - this.tableLeft.Name = "tableLeft"; - this.tableLeft.RowCount = 2; - this.tableLeft.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLeft.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLeft.Size = new System.Drawing.Size(411, 381); - this.tableLeft.TabIndex = 1; - // - // layoutControl - // - this.layoutControl.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.layoutControl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(127)))), ((int)(((byte)(127))))); - this.layoutControl.Location = new System.Drawing.Point(79, 3); - this.layoutControl.Name = "layoutControl"; - this.layoutControl.Padding = new System.Windows.Forms.Padding(10); - this.layoutControl.ScreenControl = null; - this.layoutControl.Size = new System.Drawing.Size(253, 186); - this.layoutControl.TabIndex = 2; - this.layoutControl.Visualizer = null; - // - // ScreenControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.tableRoot); - this.Name = "ScreenControl"; - this.Size = new System.Drawing.Size(773, 387); - this.tableRoot.ResumeLayout(false); - this.tableRoot.PerformLayout(); - this.tableRight.ResumeLayout(false); - this.grEditorOptions.ResumeLayout(false); - this.grEditorOptions.PerformLayout(); - this.tableLeft.ResumeLayout(false); - this.ResumeLayout(false); - + this.panelItemList = new System.Windows.Forms.FlowLayoutPanel(); + this.groupScreenOptions = new System.Windows.Forms.GroupBox(); + this.tableRoot = new System.Windows.Forms.TableLayoutPanel(); + this.tableRight = new System.Windows.Forms.TableLayoutPanel(); + this.groupOptions = new System.Windows.Forms.GroupBox(); + this.grEditorOptions = new System.Windows.Forms.GroupBox(); + this.cbUseNameCaptions = new System.Windows.Forms.CheckBox(); + this.btnClearAll = new System.Windows.Forms.Button(); + this.btnPaste = new System.Windows.Forms.Button(); + this.btnCopy = new System.Windows.Forms.Button(); + this.cbReducedView = new System.Windows.Forms.CheckBox(); + this.tableLeft = new System.Windows.Forms.TableLayoutPanel(); + this.layoutControl = new OSDConfigurator.GUI.LayoutControl(); + this.cbHighDefView = new System.Windows.Forms.CheckBox(); + this.tableRoot.SuspendLayout(); + this.tableRight.SuspendLayout(); + this.grEditorOptions.SuspendLayout(); + this.tableLeft.SuspendLayout(); + this.SuspendLayout(); + // + // panelItemList + // + this.panelItemList.AutoScroll = true; + this.panelItemList.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelItemList.Location = new System.Drawing.Point(4, 196); + this.panelItemList.MinimumSize = new System.Drawing.Size(50, 50); + this.panelItemList.Name = "panelItemList"; + this.panelItemList.Size = new System.Drawing.Size(405, 183); + this.panelItemList.TabIndex = 1; + // + // groupScreenOptions + // + this.groupScreenOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupScreenOptions.Location = new System.Drawing.Point(3, 123); + this.groupScreenOptions.Name = "groupScreenOptions"; + this.groupScreenOptions.Size = new System.Drawing.Size(344, 124); + this.groupScreenOptions.TabIndex = 1; + this.groupScreenOptions.TabStop = false; + this.groupScreenOptions.Text = "Screen Options"; + // + // tableRoot + // + this.tableRoot.ColumnCount = 2; + this.tableRoot.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableRoot.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableRoot.Controls.Add(this.tableRight, 1, 0); + this.tableRoot.Controls.Add(this.tableLeft, 0, 0); + this.tableRoot.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableRoot.Location = new System.Drawing.Point(0, 0); + this.tableRoot.Name = "tableRoot"; + this.tableRoot.RowCount = 1; + this.tableRoot.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableRoot.Size = new System.Drawing.Size(773, 387); + this.tableRoot.TabIndex = 5; + // + // tableRight + // + this.tableRight.ColumnCount = 1; + this.tableRight.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableRight.Controls.Add(this.groupOptions, 0, 2); + this.tableRight.Controls.Add(this.groupScreenOptions, 0, 1); + this.tableRight.Controls.Add(this.grEditorOptions, 0, 0); + this.tableRight.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableRight.Location = new System.Drawing.Point(420, 3); + this.tableRight.MaximumSize = new System.Drawing.Size(400, 0); + this.tableRight.Name = "tableRight"; + this.tableRight.RowCount = 3; + this.tableRight.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableRight.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableRight.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableRight.Size = new System.Drawing.Size(350, 381); + this.tableRight.TabIndex = 0; + // + // groupOptions + // + this.groupOptions.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupOptions.Location = new System.Drawing.Point(3, 253); + this.groupOptions.Name = "groupOptions"; + this.groupOptions.Size = new System.Drawing.Size(344, 125); + this.groupOptions.TabIndex = 0; + this.groupOptions.TabStop = false; + this.groupOptions.Text = "Item Options"; + // + // grEditorOptions + // + this.grEditorOptions.Controls.Add(this.cbHighDefView); + this.grEditorOptions.Controls.Add(this.cbUseNameCaptions); + this.grEditorOptions.Controls.Add(this.btnClearAll); + this.grEditorOptions.Controls.Add(this.btnPaste); + this.grEditorOptions.Controls.Add(this.btnCopy); + this.grEditorOptions.Controls.Add(this.cbReducedView); + this.grEditorOptions.Dock = System.Windows.Forms.DockStyle.Top; + this.grEditorOptions.Location = new System.Drawing.Point(3, 3); + this.grEditorOptions.Name = "grEditorOptions"; + this.grEditorOptions.Size = new System.Drawing.Size(344, 114); + this.grEditorOptions.TabIndex = 2; + this.grEditorOptions.TabStop = false; + this.grEditorOptions.Text = "Editor Options"; + // + // cbUseNameCaptions + // + this.cbUseNameCaptions.AutoSize = true; + this.cbUseNameCaptions.Location = new System.Drawing.Point(23, 58); + this.cbUseNameCaptions.Name = "cbUseNameCaptions"; + this.cbUseNameCaptions.Size = new System.Drawing.Size(103, 19); + this.cbUseNameCaptions.TabIndex = 4; + this.cbUseNameCaptions.Text = "Show Names"; + this.cbUseNameCaptions.UseVisualStyleBackColor = true; + // + // btnClearAll + // + this.btnClearAll.Location = new System.Drawing.Point(127, 58); + this.btnClearAll.Name = "btnClearAll"; + this.btnClearAll.Size = new System.Drawing.Size(93, 33); + this.btnClearAll.TabIndex = 3; + this.btnClearAll.Text = "Clear All"; + this.btnClearAll.UseVisualStyleBackColor = true; + // + // btnPaste + // + this.btnPaste.Location = new System.Drawing.Point(226, 19); + this.btnPaste.Name = "btnPaste"; + this.btnPaste.Size = new System.Drawing.Size(93, 33); + this.btnPaste.TabIndex = 2; + this.btnPaste.Text = "Paste Layout"; + this.btnPaste.UseVisualStyleBackColor = true; + // + // btnCopy + // + this.btnCopy.Location = new System.Drawing.Point(127, 19); + this.btnCopy.Name = "btnCopy"; + this.btnCopy.Size = new System.Drawing.Size(93, 33); + this.btnCopy.TabIndex = 1; + this.btnCopy.Text = "Copy Layout"; + this.btnCopy.UseVisualStyleBackColor = true; + // + // cbReducedView + // + this.cbReducedView.AutoSize = true; + this.cbReducedView.Location = new System.Drawing.Point(23, 28); + this.cbReducedView.Name = "cbReducedView"; + this.cbReducedView.Size = new System.Drawing.Size(82, 19); + this.cbReducedView.TabIndex = 0; + this.cbReducedView.Text = "Decrease"; + this.cbReducedView.UseVisualStyleBackColor = true; + // + // tableLeft + // + this.tableLeft.AutoScroll = true; + this.tableLeft.AutoSize = true; + this.tableLeft.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLeft.ColumnCount = 1; + this.tableLeft.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLeft.Controls.Add(this.layoutControl, 0, 0); + this.tableLeft.Controls.Add(this.panelItemList, 0, 1); + this.tableLeft.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLeft.Location = new System.Drawing.Point(3, 3); + this.tableLeft.Name = "tableLeft"; + this.tableLeft.RowCount = 2; + this.tableLeft.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLeft.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLeft.Size = new System.Drawing.Size(411, 381); + this.tableLeft.TabIndex = 1; + // + // layoutControl + // + this.layoutControl.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.layoutControl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(127)))), ((int)(((byte)(127))))); + this.layoutControl.Location = new System.Drawing.Point(80, 4); + this.layoutControl.Name = "layoutControl"; + this.layoutControl.Padding = new System.Windows.Forms.Padding(10); + this.layoutControl.ScreenControl = null; + this.layoutControl.ScreenSize = new System.Drawing.Size(253, 186); + this.layoutControl.Size = new System.Drawing.Size(253, 186); + this.layoutControl.TabIndex = 2; + this.layoutControl.Visualizer = null; + // + // cbHighDefView + // + this.cbHighDefView.AutoSize = true; + this.cbHighDefView.Location = new System.Drawing.Point(23, 88); + this.cbHighDefView.Name = "cbHighDefView"; + this.cbHighDefView.Size = new System.Drawing.Size(108, 24); + this.cbHighDefView.TabIndex = 5; + this.cbHighDefView.Text = "HD Layout"; + this.cbHighDefView.UseVisualStyleBackColor = true; + // + // ScreenControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.tableRoot); + this.Name = "ScreenControl"; + this.Size = new System.Drawing.Size(773, 387); + this.tableRoot.ResumeLayout(false); + this.tableRoot.PerformLayout(); + this.tableRight.ResumeLayout(false); + this.grEditorOptions.ResumeLayout(false); + this.grEditorOptions.PerformLayout(); + this.tableLeft.ResumeLayout(false); + this.ResumeLayout(false); + } #endregion @@ -232,6 +245,7 @@ private void InitializeComponent() private System.Windows.Forms.Button btnClearAll; private System.Windows.Forms.Button btnCopy; private System.Windows.Forms.Button btnPaste; - private System.Windows.Forms.CheckBox cbUseNameCaptions; + private System.Windows.Forms.CheckBox cbUseNameCaptions; + private System.Windows.Forms.CheckBox cbHighDefView; } } diff --git a/ExtLibs/OSDConfigurator/GUI/ScreenControl.cs b/ExtLibs/OSDConfigurator/GUI/ScreenControl.cs index b3cd21ff59..c34fdea3e7 100644 --- a/ExtLibs/OSDConfigurator/GUI/ScreenControl.cs +++ b/ExtLibs/OSDConfigurator/GUI/ScreenControl.cs @@ -62,6 +62,7 @@ public ScreenControl(OSDScreen screen, IItemCaptionProvider captionProvider) cbReducedView.CheckedChanged += (s, e) => SetViewSize(); cbUseNameCaptions.CheckedChanged += (s, e) => SetCaptionMode(); + cbHighDefView.CheckedChanged += (s, e) => SetHighDefView(); btnClearAll.Click += (s, e) => { foreach (var i in screen.Items) i.Enabled.Value = 0; }; @@ -79,8 +80,30 @@ private void SetCaptionMode() } private void SetViewSize() - { - layoutControl.CharSize = cbReducedView.Checked ? new Size(12, 18) : new Size(24, 36); + { + if (cbHighDefView.Checked) + { + layoutControl.CharSize = cbReducedView.Checked ? new Size(12, 18) : new Size(18, 27); + } + else + { + layoutControl.CharSize = cbReducedView.Checked ? new Size(12, 18) : new Size(24, 36); + } + } + + private void SetHighDefView() + { + if(cbHighDefView.Checked) + { + layoutControl.ScreenSize = new Size(60, 22); + layoutControl.IsHighDef = true; + } + else + { + layoutControl.ScreenSize = new Size(30, 16); + layoutControl.IsHighDef = false; + } + SetViewSize(); } protected override void OnLoad(EventArgs e) diff --git a/ExtLibs/OSDConfigurator/GUI/ScreenControl.resx b/ExtLibs/OSDConfigurator/GUI/ScreenControl.resx index 1af7de150c..29dcb1b3a3 100644 --- a/ExtLibs/OSDConfigurator/GUI/ScreenControl.resx +++ b/ExtLibs/OSDConfigurator/GUI/ScreenControl.resx @@ -1,120 +1,120 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/ExtLibs/OSDConfigurator/GUI/Visualizer.cs b/ExtLibs/OSDConfigurator/GUI/Visualizer.cs index 9553073f29..3ebd8b5146 100644 --- a/ExtLibs/OSDConfigurator/GUI/Visualizer.cs +++ b/ExtLibs/OSDConfigurator/GUI/Visualizer.cs @@ -10,10 +10,13 @@ public class Visualizer { private Size charSizePix= new Size(24, 36); private readonly Size fontCharSizePix = new Size(12, 18); - private readonly Size screenSizeChar = new Size(30, 16); + private Size screenSizeChar = new Size(30, 16); private readonly int NtscRows = 13; + private readonly int DJICols = 50; + private readonly int DJIRows = 18; private readonly IItemCaptionProvider captionProvider; - private static Font noteFont = new Font("Arial", 6, FontStyle.Regular); + private static Font sdNoteFont = new Font("Arial", 6, FontStyle.Regular); + private static Font hdNoteFont = new Font("Arial", 8, FontStyle.Regular); private static List font; @@ -30,6 +33,11 @@ public Size GetCanvasSize(Size charSizePix) return new Size(charSizePix.Width * screenSizeChar.Width, charSizePix.Height * screenSizeChar.Height); } + public void SetScreenSizeChar(Size screenSize) + { + screenSizeChar = screenSize; + } + public Point ToOSDLocation(Point screenPoint) { screenPoint.X = screenPoint.X < 0 ? 0 : screenPoint.X; @@ -108,11 +116,18 @@ public bool Contains(OSDItem item, Point point) return ToScreenRectangle(item).Contains(point); } - internal void DrawBackground(Graphics g) + internal void DrawSDBackground(Graphics g) { g.DrawLine(Pens.DimGray, 0, charSizePix.Height * NtscRows, charSizePix.Width * screenSizeChar.Width, charSizePix.Height * NtscRows); - g.DrawString("NTSC", noteFont, Brushes.Black, noteFont.Size, charSizePix.Height * NtscRows - noteFont.Size * 2); - g.DrawString("PAL", noteFont, Brushes.Black, noteFont.Size, charSizePix.Height * NtscRows + noteFont.Size * 1.5f); + g.DrawString("NTSC", sdNoteFont, Brushes.Black, sdNoteFont.Size, charSizePix.Height * NtscRows - sdNoteFont.Size * 2); + g.DrawString("PAL", sdNoteFont, Brushes.Black, sdNoteFont.Size, charSizePix.Height * NtscRows + sdNoteFont.Size * 1.5f); + } + internal void DrawHDBackground(Graphics g) + { + g.DrawLine(Pens.DimGray, 0, charSizePix.Height * DJIRows, charSizePix.Width * DJICols, charSizePix.Height * DJIRows); + g.DrawLine(Pens.DimGray, charSizePix.Width * DJICols, charSizePix.Height * DJIRows, charSizePix.Width * DJICols, 0); + g.DrawString("50x18", hdNoteFont, Brushes.Black, charSizePix.Width * DJICols - 4.5f * hdNoteFont.Size, charSizePix.Height * DJIRows - hdNoteFont.Size * 2); + g.DrawString("60x22", hdNoteFont, Brushes.Black, charSizePix.Width * screenSizeChar.Width - 4.5f * hdNoteFont.Size, charSizePix.Height * screenSizeChar.Height - hdNoteFont.Size * 2); } } }