diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs index 0e2d80c095..2579ca2895 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs @@ -288,10 +288,11 @@ namespace BizHawk.Client.EmuHawk int x = locationOnForm.X - Tastudio.ScreenshotControl.Width; int y = locationOnForm.Y; // keep consistent height, helps when conparing screenshots - if (x < 0) x = 0; + if (x < 1) x = 1; + Tastudio.ScreenshotControl.UserText = ""; + Tastudio.ScreenshotControl.RecalculatePadding(); Tastudio.ScreenshotControl.Location = new Point(x, y); - Tastudio.ScreenshotControl.Visible = true; Tastudio.ScreenshotControl.Branch = branch; Tastudio.ScreenshotControl.Refresh(); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/ScreenshotPopupControl.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/ScreenshotPopupControl.cs index 4295aa1413..19a67dc2e0 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/ScreenshotPopupControl.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/ScreenshotPopupControl.cs @@ -12,8 +12,8 @@ namespace BizHawk.Client.EmuHawk public ScreenshotPopupControl() { SetStyle(ControlStyles.SupportsTransparentBackColor, true); - SetStyle(ControlStyles.Opaque, true); - this.BackColor = Color.Transparent; + //SetStyle(ControlStyles.Opaque, true); + //this.BackColor = Color.Transparent; InitializeComponent(); } @@ -28,7 +28,12 @@ namespace BizHawk.Client.EmuHawk protected override void OnPaint(PaintEventArgs e) { var bitmap = Branch.OSDFrameBuffer.ToSysdrawingBitmap(); - e.Graphics.DrawImage(bitmap, new Rectangle(0, 0, Width, Height)); + e.Graphics.DrawImage(bitmap, new Rectangle(0, 0, Width, DrawingHeight)); + if (UserPadding > 0) + { + e.Graphics.DrawRectangle(new Pen(Brushes.Black), new Rectangle(new Point(0, DrawingHeight), new Size(Width - 1, UserPadding - 1))); + e.Graphics.DrawString(UserText, _font, Brushes.Black, new Rectangle(1, DrawingHeight, Width - 1, Height)); + } base.OnPaint(e); } @@ -41,5 +46,19 @@ namespace BizHawk.Client.EmuHawk { // todo: switch screenshots by hotkey } + + public void RecalculatePadding() + { + UserPadding = (int)Graphics.FromHwnd(this.Handle).MeasureString(UserText, _font, Width).Height; + if (UserPadding > 0) + UserPadding += 2; + Height = DrawingHeight + UserPadding; + } + + public int DrawingHeight = 0; + public int UserPadding = 0; + public string UserText; + + private Font _font = new Font(new FontFamily("Courier New"), 8); } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 38b0b26e7f..d97fe233ec 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -110,9 +110,8 @@ namespace BizHawk.Client.EmuHawk width = 320; height = (int)((double)(height) * ratio); } - - - ScreenshotControl.Size = new Size(width, height); + ScreenshotControl.DrawingHeight = height; + ScreenshotControl.Size = new Size(width, ScreenshotControl.DrawingHeight + ScreenshotControl.UserPadding); } ScreenshotControl.Visible = false;