tastodio: completely redo branch screenshot popup just to avoid cropping

moved it to ToolTip, which feels like the proper way to do it
This commit is contained in:
feos 2017-01-22 17:46:54 +03:00
parent 74adace569
commit d8d0c62adf
9 changed files with 159 additions and 331 deletions

View File

@ -1082,12 +1082,7 @@
<Compile Include="tools\TAStudio\PatternsForm.Designer.cs">
<DependentUpon>PatternsForm.cs</DependentUpon>
</Compile>
<Compile Include="tools\TAStudio\ScreenshotPopupControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="tools\TAStudio\ScreenshotPopupControl.Designer.cs">
<DependentUpon>ScreenshotPopupControl.cs</DependentUpon>
</Compile>
<Compile Include="tools\TAStudio\ScreenshotPopup.cs" />
<Compile Include="tools\TAStudio\TAStudio.Callbacks.cs">
<DependentUpon>TAStudio.cs</DependentUpon>
<SubType>Form</SubType>
@ -1579,6 +1574,7 @@
</EmbeddedResource>
<EmbeddedResource Include="tools\TAStudio\BookmarksBranchesBox.resx">
<DependentUpon>BookmarksBranchesBox.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="tools\TAStudio\DefaultGreenzoneSettings.resx">
<DependentUpon>DefaultGreenzoneSettings.cs</DependentUpon>
@ -1601,9 +1597,6 @@
<EmbeddedResource Include="tools\TAStudio\PlaybackBox.resx">
<DependentUpon>PlaybackBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\TAStudio\ScreenshotPopupControl.resx">
<DependentUpon>ScreenshotPopupControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\TAStudio\TAStudio.resx">
<DependentUpon>TAStudio.cs</DependentUpon>
</EmbeddedResource>
@ -2106,6 +2099,7 @@
<None Include="images\JumpTo.png" />
<None Include="images\ENE.png" />
<None Include="images\ESE.png" />
<None Include="images\5757344.png" />
<Content Include="images\logo.ico" />
<None Include="images\Paste.png" />
<None Include="images\reboot.png" />

View File

@ -45,6 +45,7 @@
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.RemoveBranchContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.ScreenshotTooltip = new System.Windows.Forms.ToolTip(this.components);
this.BranchView = new BizHawk.Client.EmuHawk.InputRoll();
this.BookmarksBranchesGroupBox.SuspendLayout();
this.BranchesContextMenu.SuspendLayout();
@ -212,29 +213,45 @@
this.RemoveBranchContextMenuItem.Text = "Remove";
this.RemoveBranchContextMenuItem.Click += new System.EventHandler(this.RemoveBranchToolStripMenuItem_Click);
//
// ScreenshotTooltip
//
this.ScreenshotTooltip.AutomaticDelay = 0;
this.ScreenshotTooltip.AutoPopDelay = 34952;
this.ScreenshotTooltip.BackColor = System.Drawing.SystemColors.Control;
this.ScreenshotTooltip.InitialDelay = 0;
this.ScreenshotTooltip.OwnerDraw = true;
this.ScreenshotTooltip.ReshowDelay = 0;
this.ScreenshotTooltip.ShowAlways = true;
this.ScreenshotTooltip.UseAnimation = false;
this.ScreenshotTooltip.UseFading = false;
this.ScreenshotTooltip.Draw += new System.Windows.Forms.DrawToolTipEventHandler(this.Screenshot_Draw);
this.ScreenshotTooltip.Popup += new System.Windows.Forms.PopupEventHandler(this.Screenshot_Popup);
//
// BranchView
//
this.BranchView.AllowColumnReorder = false;
this.BranchView.AllowColumnResize = false;
this.BranchView.allowRightClickSelecton = true;
this.BranchView.AlwaysScroll = false;
this.BranchView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.BranchView.CellHeightPadding = 0;
this.BranchView.ContextMenuStrip = this.BranchesContextMenu;
this.BranchView.allowRightClickSelecton = true;
this.BranchView.FullRowSelect = true;
this.BranchView.HideWasLagFrames = false;
this.BranchView.HorizontalOrientation = false;
this.BranchView.HoverInterval = 1;
this.BranchView.LagFramesToHide = 0;
this.BranchView.letKeysModifySelection = false;
this.BranchView.Location = new System.Drawing.Point(6, 19);
this.BranchView.MaxCharactersInHorizontal = 1;
this.BranchView.MultiSelect = false;
this.BranchView.Name = "BranchView";
this.BranchView.RowCount = 0;
this.BranchView.ScrollSpeed = 13;
this.BranchView.SeekingCutoffInterval = 0;
this.BranchView.Size = new System.Drawing.Size(186, 224);
this.BranchView.suspendHotkeys = false;
this.BranchView.TabIndex = 0;
this.BranchView.CellHovered += new BizHawk.Client.EmuHawk.InputRoll.HoverEventHandler(this.BranchView_CellHovered);
this.BranchView.CellDropped += new BizHawk.Client.EmuHawk.InputRoll.CellDroppedEvent(this.BranchView_CellDropped);
@ -275,5 +292,6 @@
private System.Windows.Forms.Button LoadBranchButton;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolTip ScreenshotTooltip;
}
}

View File

@ -19,8 +19,8 @@ namespace BizHawk.Client.EmuHawk
private const string BranchNumberColumnName = "BranchNumberColumn";
private const string FrameColumnName = "FrameColumn";
private const string UserTextColumnName = "TextColumn";
private readonly PlatformFrameRates FrameRates = new PlatformFrameRates();
private ScreenshotPopup Screenshot = new ScreenshotPopup();
private TasMovie Movie { get { return Tastudio.CurrentTasMovie; } }
public TAStudio Tastudio { get; set; }
@ -64,6 +64,8 @@ namespace BizHawk.Client.EmuHawk
BranchView.QueryItemBkColor += QueryItemBkColor;
}
#region Query callbacks
private void QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
{
text = string.Empty;
@ -119,6 +121,10 @@ namespace BizHawk.Client.EmuHawk
}
}
#endregion
#region Actions
public void Branch()
{
TasBranch branch = CreateBranch();
@ -405,27 +411,9 @@ namespace BizHawk.Client.EmuHawk
}
}
private void ScreenShotPopUp(TasBranch branch, int index)
{
Point locationOnForm = this.FindForm().PointToClient(
this.Parent.PointToScreen(this.Location));
#endregion
int x = locationOnForm.X - Tastudio.ScreenshotControl.Width;
int y = locationOnForm.Y; // keep consistent height, helps when conparing screenshots
if (x < 1) x = 1;
Tastudio.ScreenshotControl.Location = new Point(x, y);
Tastudio.ScreenshotControl.Visible = true;
Tastudio.ScreenshotControl.Branch = branch;
Tastudio.ScreenshotControl.RecalculateHeight();
Tastudio.ScreenshotControl.Refresh();
}
private void CloseScreenShotPopUp()
{
Tastudio.ScreenshotControl.Visible = false;
}
#region Events
private void BranchView_MouseDown(object sender, MouseEventArgs e)
{
@ -464,7 +452,7 @@ namespace BizHawk.Client.EmuHawk
{
if (BranchView.CurrentCell == null || !BranchView.CurrentCell.RowIndex.HasValue || BranchView.CurrentCell.Column == null)
{
CloseScreenShotPopUp();
//not sure if we need to explicitly hide the screenshot here as well
}
else if (BranchView.CurrentCell.Column.Name == BranchNumberColumnName)
{
@ -474,25 +462,36 @@ namespace BizHawk.Client.EmuHawk
private void BranchView_MouseLeave(object sender, EventArgs e)
{
// Tastudio.ScreenshotControl.Visible = false;
ScreenshotTooltip.Hide(this);
}
private void BranchView_CellHovered(object sender, InputRoll.CellEventArgs e)
{
if (e.NewCell != null && e.NewCell.RowIndex.HasValue && e.NewCell.Column != null && e.NewCell.RowIndex < Movie.BranchCount)
{
if (e.NewCell.Column.Name == BranchNumberColumnName)
if (BranchView.CurrentCell.Column.Name == BranchNumberColumnName &&
BranchView.CurrentCell.RowIndex.HasValue &&
BranchView.CurrentCell.RowIndex < Movie.BranchCount)
{
ScreenShotPopUp(GetBranch(e.NewCell.RowIndex.Value), e.NewCell.RowIndex.Value);
TasBranch branch = GetBranch(BranchView.CurrentCell.RowIndex.Value);
int width = Tastudio.VideoProvider.BufferWidth;
int height = Tastudio.VideoProvider.BufferHeight;
Screenshot.UpdateValues(branch, width, height,
(int)Graphics.FromHwnd(this.Handle).MeasureString(
branch.UserText, Screenshot.Font, width).Height);
Point location = Location;
location.Offset(-Screenshot.Width, 0);
ScreenshotTooltip.Show(" ", this, location);
}
else
{
CloseScreenShotPopUp();
ScreenshotTooltip.Hide(this);
}
}
else
{
CloseScreenShotPopUp();
ScreenshotTooltip.Hide(this);
}
}
@ -503,5 +502,17 @@ namespace BizHawk.Client.EmuHawk
Movie.SwapBranches(e.OldCell.RowIndex.Value, e.NewCell.RowIndex.Value);
}
}
private void Screenshot_Popup(object sender, PopupEventArgs e)
{
Screenshot.Popup(sender, e);
}
private void Screenshot_Draw(object sender, DrawToolTipEventArgs e)
{
Screenshot.Draw(sender, e);
}
#endregion
}
}

View File

@ -118,9 +118,12 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>179, 17</value>
<value>297, 18</value>
</metadata>
<metadata name="BranchesContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
<value>23, 17</value>
</metadata>
<metadata name="ScreenshotTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>171, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,74 @@
using System;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
public class ScreenshotPopup
{
public TasBranch Branch { get; set; }
public Font Font;
public FontStyle FontStyle;
public int Width;
public int Height;
public int FontSize;
public int DrawingHeight;
public int Padding;
public string Text;
public ScreenshotPopup()
{
Width = 0;
Height = 0;
FontSize = 10;
FontStyle = FontStyle.Regular;
Font = new Font(FontFamily.GenericMonospace, FontSize, FontStyle);
DrawingHeight = 0;
Padding = 0;
}
public void UpdateValues(TasBranch branch, int width, int height, int padding)
{
Branch = branch;
Width = width;
Padding = padding;
DrawingHeight = height;
Text = Branch.UserText;
// Set the screenshot to "1x" resolution of the core
// cores like n64 and psx are going to still have sizes too big for the control, so cap them
if (Width > 320)
{
double ratio = 320.0 / (double)Width;
Width = 320;
DrawingHeight = (int)((double)(DrawingHeight) * ratio);
}
if (Padding > 0)
Padding += 2;
Height = DrawingHeight + Padding;
}
public void Popup(object sender, PopupEventArgs e)
{
e.ToolTipSize = new Size(Width, Height);
}
public void Draw(object sender, DrawToolTipEventArgs e)
{
Branch.OSDFrameBuffer.DiscardAlpha();
var bitmap = Branch.OSDFrameBuffer.ToSysdrawingBitmap();
e.DrawBackground();
e.DrawBorder();
e.Graphics.DrawImage(bitmap, e.Bounds.Left, e.Bounds.Top);
if (Padding > 0)
e.Graphics.DrawString(Text, Font, Brushes.Black,
new Rectangle(3, DrawingHeight, Width - 3, Height));
}
}
}

View File

@ -1,47 +0,0 @@
namespace BizHawk.Client.EmuHawk
{
partial class ScreenshotPopupControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// ScreenshotPopupControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "ScreenshotPopupControl";
this.Size = new System.Drawing.Size(237, 255);
this.Load += new System.EventHandler(this.ScreenshotPopupControl_Load);
this.ResumeLayout(false);
this.MouseLeave += new System.EventHandler(ScreenshotPopupControl_MouseLeave);
this.MouseHover += new System.EventHandler(ScreenshotPopupControl_MouseHover);
}
#endregion
}
}

View File

@ -1,77 +0,0 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
public partial class ScreenshotPopupControl : UserControl
{
public TasBranch Branch { get; set; }
public int DrawingHeight = 0;
public int UserPadding = 0;
public int UserFontSize = 10; // because why not?
public FontStyle UserFontStyle = FontStyle.Regular;
public string UserText;
private Font UserFont;
public ScreenshotPopupControl()
{
//SetStyle(ControlStyles.SupportsTransparentBackColor, true);
//SetStyle(ControlStyles.Opaque, true);
//this.BackColor = Color.Transparent;
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
Branch.OSDFrameBuffer.DiscardAlpha();
var bitmap = Branch.OSDFrameBuffer.ToSysdrawingBitmap();
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, UserFont, Brushes.Black, new Rectangle(2, DrawingHeight, Width - 2, Height));
}
base.OnPaint(e);
}
public void SetFontStyle(FontStyle style)
{
UserFontStyle = style;
}
public void SetFontSize(int size)
{
UserFontSize = size;
}
public void RecalculateHeight()
{
UserFont = new Font(FontFamily.GenericMonospace, UserFontSize, UserFontStyle);
UserText = Branch.UserText;
UserPadding = (int)Graphics.FromHwnd(this.Handle).MeasureString(UserText, UserFont, Width).Height;
if (UserPadding > 0)
UserPadding += 2;
Height = DrawingHeight + UserPadding;
}
private void ScreenshotPopupControl_MouseLeave(object sender, EventArgs e)
{
Visible = false;
}
private void ScreenshotPopupControl_MouseHover(object sender, EventArgs e)
{
// todo: switch screenshots by hotkey
}
private void ScreenshotPopupControl_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -22,13 +22,12 @@ namespace BizHawk.Client.EmuHawk
// TODO: UI flow that conveniently allows to start from savestate
private const string CursorColumnName = "CursorColumn";
private const string FrameColumnName = "FrameColumn";
private readonly List<TasClipboardEntry> _tasClipboard = new List<TasClipboardEntry>();
private BackgroundWorker _saveBackgroundWorker;
private BackgroundWorker _seekBackgroundWorker;
private MovieEndAction _originalEndAction; // The movie end behavior selected by the user (that is overridden by TAStudio)
private UndoHistoryForm _undoForm;
private Timer _autosaveTimer = new Timer();
private readonly List<TasClipboardEntry> _tasClipboard = new List<TasClipboardEntry>();
private Dictionary<string, string> GenerateColumnNames()
{
var lg = Global.MovieSession.LogGeneratorInstance();
@ -36,20 +35,28 @@ namespace BizHawk.Client.EmuHawk
return (lg as Bk2LogEntryGenerator).Map();
}
private UndoHistoryForm _undoForm;
private Timer _autosaveTimer = new Timer();
public ScreenshotPopupControl ScreenshotControl = new ScreenshotPopupControl
{
Size = new Size(256, 240),
};
public bool IsInMenuLoop { get; private set; }
public string statesPath
{
get { return PathManager.MakeAbsolutePath(Global.Config.PathEntries["Global", "TAStudio states"].Path, null); }
}
public bool IsInMenuLoop { get; private set; }
public TasMovie CurrentTasMovie
{
get { return Global.MovieSession.Movie as TasMovie; }
}
public MainForm Mainform
{
get { return GlobalWin.MainForm; }
}
/// <summary>
/// Separates "restore last position" logic from seeking caused by navigation.
/// TASEditor never kills LastPositionFrame, and it only pauses on it, if it hasn't been greenzoned beforehand and middle mouse button was pressed.
/// </summary>
public int LastPositionFrame { get; set; }
[ConfigPersist]
public TAStudioSettings Settings { get; set; }
@ -105,23 +112,6 @@ namespace BizHawk.Client.EmuHawk
public int BranchMarkerSplitDistance { get; set; }
}
public TasMovie CurrentTasMovie
{
get { return Global.MovieSession.Movie as TasMovie; }
}
public MainForm Mainform
{
get { return GlobalWin.MainForm; }
}
/// <summary>
/// Separates "restore last position" logic from seeking caused by navigation.
/// TASEditor never kills LastPositionFrame, and it only pauses on it,
/// if it hasn't been greenzoned beforehand and middle mouse button was pressed.
/// </summary>
public int LastPositionFrame { get; set; }
#region "Initializing"
public TAStudio()
@ -270,24 +260,6 @@ namespace BizHawk.Client.EmuHawk
return;
}
// Set the screenshot to "1x" resolution of the core
// cores like n64 and psx are going to still have sizes too big for the control, so cap them
int width = VideoProvider.BufferWidth;
int height = VideoProvider.BufferHeight;
if (width > 320)
{
double ratio = 320.0 / (double)width;
width = 320;
height = (int)((double)(height) * ratio);
}
ScreenshotControl.DrawingHeight = height;
ScreenshotControl.Size = new Size(width, ScreenshotControl.DrawingHeight + ScreenshotControl.UserPadding);
ScreenshotControl.Visible = false;
Controls.Add(ScreenshotControl);
ScreenshotControl.BringToFront();
SetColumnsFromCurrentStickies();
if (VersionInfo.DeveloperBuild)