diff --git a/BizHawk.Client.EmuHawk/CustomControls/GDITextRenderer.cs b/BizHawk.Client.EmuHawk/CustomControls/GDITextRenderer.cs index 2423fa918f..e49371c74b 100644 --- a/BizHawk.Client.EmuHawk/CustomControls/GDITextRenderer.cs +++ b/BizHawk.Client.EmuHawk/CustomControls/GDITextRenderer.cs @@ -48,6 +48,12 @@ namespace BizHawk.Client.EmuHawk.CustomControls _hdc = GetDC(c.Handle); } + public void NewHdc(IntPtr hdc) + { + _hdc = hdc; + SetBkMode(_hdc, (int)BkModes.OPAQUE); + } + System.Windows.Forms.Control _c; /// @@ -57,7 +63,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls { _g = g; _hdc = _g.GetHdc(); - SetBkMode(_hdc, 1); + SetBkMode(_hdc, (int)BkModes.OPAQUE); } /// @@ -106,7 +112,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls /// the font to use to draw the string /// the text color to set /// the location to start string draw (top-left) - public void DrawString(String str, Font font, Color color, Point point) + public void DrawString(String str, Font font, Point point) { TextOut(_hdc, point.X, point.Y, str, str.Length); } @@ -426,4 +432,10 @@ namespace BizHawk.Client.EmuHawk.CustomControls DC_BRUSH = 18, DC_PEN = 19, } + + public enum BkModes + { + TRANSPARENT = 1, + OPAQUE = 2 + } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs index ddea2bf62c..37d146c4aa 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/InputRoll.cs @@ -214,7 +214,9 @@ namespace BizHawk.Client.EmuHawk int start = 0; foreach (var column in Columns) { - gdi.DrawString(column.Text, this.Font, Color.Black, new Point(CellPadding, start + CellPadding)); + var point = new Point(CellPadding, start + CellPadding); + gdi.PrepDrawString(column.Text, this.Font, this.ForeColor, point); + gdi.DrawString(column.Text, this.Font, point); start += CellHeight; } } @@ -225,7 +227,7 @@ namespace BizHawk.Client.EmuHawk { var point = new Point(start + CellPadding, CellPadding); gdi.PrepDrawString(column.Text, this.Font, this.ForeColor, point); - gdi.DrawString(column.Text, this.Font, Color.Black, point); + gdi.DrawString(column.Text, this.Font, point); start += CalcWidth(column); } } @@ -235,6 +237,8 @@ namespace BizHawk.Client.EmuHawk protected override void OnPaint(PaintEventArgs e) { + Gdi.NewHdc(e.Graphics.GetHdc()); + // Header if (Columns.Any()) {