Debugger: Added copy to clipbiard/save as png options for ppu viewers

This commit is contained in:
Sour 2019-05-20 14:06:47 -04:00
parent 20e2bb8b12
commit a382bce3bd
10 changed files with 176 additions and 159 deletions

View file

@ -59,6 +59,9 @@ namespace Mesen.GUI.Config
[ShortcutName("Zoom Out")]
public XmlKeys ZoomOut = Keys.Control | Keys.OemMinus;
[ShortcutName("Save as PNG")]
public XmlKeys SaveAsPng = Keys.Control | Keys.S;
[ShortcutName("Edit in Memory Viewer")]
public XmlKeys CodeWindow_EditInMemoryViewer = Keys.F1;
[ShortcutName("View in disassembly")]

View file

@ -1,123 +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>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -8,6 +8,8 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Mesen.GUI.Controls;
using Mesen.GUI.Forms;
using System.Drawing.Imaging;
namespace Mesen.GUI.Debugger.PpuViewer
{
@ -131,5 +133,20 @@ namespace Mesen.GUI.Debugger.PpuViewer
ctrlPanel.HorizontalScroll.Value = 0;
ctrlPanel.HorizontalScroll.Value = 0;
}
public void CopyToClipboard()
{
Clipboard.SetImage(this.Image);
}
public void SaveAsPng()
{
using(SaveFileDialog sfd = new SaveFileDialog()) {
sfd.SetFilter("PNG files|*.png");
if(sfd.ShowDialog() == DialogResult.OK) {
this.Image.Save(sfd.FileName, ImageFormat.Png);
}
}
}
}
}

View file

@ -41,6 +41,9 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.mnuZoomIn = new System.Windows.Forms.ToolStripMenuItem();
this.mnuZoomOut = new System.Windows.Forms.ToolStripMenuItem();
this.mnuCopyToClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.mnuSaveAsPng = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
((System.ComponentModel.ISupportInitialize)(this.ctrlSplitContainer)).BeginInit();
this.ctrlSplitContainer.Panel1.SuspendLayout();
this.ctrlSplitContainer.Panel2.SuspendLayout();
@ -81,12 +84,16 @@
// ctrlImagePanel
//
this.ctrlImagePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlImagePanel.GridSizeX = 0;
this.ctrlImagePanel.GridSizeY = 0;
this.ctrlImagePanel.Image = null;
this.ctrlImagePanel.ImageScale = 1;
this.ctrlImagePanel.ImageSize = new System.Drawing.Size(0, 0);
this.ctrlImagePanel.Location = new System.Drawing.Point(0, 0);
this.ctrlImagePanel.Name = "ctrlImagePanel";
this.ctrlImagePanel.Overlay = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ctrlImagePanel.Selection = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ctrlImagePanel.SelectionWrapPosition = 0;
this.ctrlImagePanel.Size = new System.Drawing.Size(512, 488);
this.ctrlImagePanel.TabIndex = 9;
this.ctrlImagePanel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ctrlImagePanel_MouseClick);
@ -114,6 +121,9 @@
// mnuFile
//
this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuCopyToClipboard,
this.mnuSaveAsPng,
this.toolStripMenuItem3,
this.mnuClose});
this.mnuFile.Name = "mnuFile";
this.mnuFile.Size = new System.Drawing.Size(37, 20);
@ -123,7 +133,7 @@
//
this.mnuClose.Image = global::Mesen.GUI.Properties.Resources.Exit;
this.mnuClose.Name = "mnuClose";
this.mnuClose.Size = new System.Drawing.Size(103, 22);
this.mnuClose.Size = new System.Drawing.Size(169, 22);
this.mnuClose.Text = "Close";
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
//
@ -182,6 +192,25 @@
this.mnuZoomOut.Text = "Zoom Out";
this.mnuZoomOut.Click += new System.EventHandler(this.mnuZoomOut_Click);
//
// mnuCopyToClipboard
//
this.mnuCopyToClipboard.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopyToClipboard.Name = "mnuCopyToClipboard";
this.mnuCopyToClipboard.Size = new System.Drawing.Size(169, 22);
this.mnuCopyToClipboard.Text = "Copy to clipboard";
//
// mnuSaveAsPng
//
this.mnuSaveAsPng.Image = global::Mesen.GUI.Properties.Resources.Export;
this.mnuSaveAsPng.Name = "mnuSaveAsPng";
this.mnuSaveAsPng.Size = new System.Drawing.Size(169, 22);
this.mnuSaveAsPng.Text = "Save as PNG";
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(166, 6);
//
// frmSpriteViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -193,6 +222,9 @@
this.MainMenuStrip = this.ctrlMesenMenuStrip1;
this.Name = "frmSpriteViewer";
this.Text = "Sprite Viewer";
this.Controls.SetChildIndex(this.ctrlMesenMenuStrip1, 0);
this.Controls.SetChildIndex(this.ctrlScanlineCycleSelect, 0);
this.Controls.SetChildIndex(this.ctrlSplitContainer, 0);
this.ctrlSplitContainer.Panel1.ResumeLayout(false);
this.ctrlSplitContainer.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ctrlSplitContainer)).EndInit();
@ -219,5 +251,8 @@
private PpuViewer.ctrlImagePanel ctrlImagePanel;
private GUI.Controls.ctrlSplitContainer ctrlSplitContainer;
private PpuViewer.ctrlSpriteList ctrlSpriteList;
private System.Windows.Forms.ToolStripMenuItem mnuCopyToClipboard;
private System.Windows.Forms.ToolStripMenuItem mnuSaveAsPng;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
}
}

View file

@ -72,6 +72,12 @@ namespace Mesen.GUI.Debugger
mnuRefresh.InitShortcut(this, nameof(DebuggerShortcutsConfig.Refresh));
mnuZoomIn.InitShortcut(this, nameof(DebuggerShortcutsConfig.ZoomIn));
mnuZoomOut.InitShortcut(this, nameof(DebuggerShortcutsConfig.ZoomOut));
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
mnuSaveAsPng.InitShortcut(this, nameof(DebuggerShortcutsConfig.SaveAsPng));
mnuCopyToClipboard.Click += (s, e) => { ctrlImagePanel.CopyToClipboard(); };
mnuSaveAsPng.Click += (s, e) => { ctrlImagePanel.SaveAsPng(); };
}
protected override void OnFormClosed(FormClosedEventArgs e)

View file

@ -53,6 +53,8 @@
this.btnPresetOam2 = new System.Windows.Forms.Button();
this.lblTileAddress = new System.Windows.Forms.Label();
this.txtTileAddress = new System.Windows.Forms.TextBox();
this.lblTileLayout = new System.Windows.Forms.Label();
this.cboLayout = new System.Windows.Forms.ComboBox();
this.ctrlImagePanel = new Mesen.GUI.Debugger.PpuViewer.ctrlImagePanel();
this.ctrlMesenMenuStrip1 = new Mesen.GUI.Controls.ctrlMesenMenuStrip();
this.mnuFile = new System.Windows.Forms.ToolStripMenuItem();
@ -64,8 +66,9 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.mnuZoomIn = new System.Windows.Forms.ToolStripMenuItem();
this.mnuZoomOut = new System.Windows.Forms.ToolStripMenuItem();
this.lblTileLayout = new System.Windows.Forms.Label();
this.cboLayout = new System.Windows.Forms.ComboBox();
this.mnuCopyToClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.mnuSaveAsPng = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ctrlPaletteViewer)).BeginInit();
@ -450,14 +453,44 @@
this.txtTileAddress.Size = new System.Drawing.Size(60, 20);
this.txtTileAddress.TabIndex = 17;
//
// lblTileLayout
//
this.lblTileLayout.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblTileLayout.AutoSize = true;
this.lblTileLayout.Location = new System.Drawing.Point(3, 61);
this.lblTileLayout.Name = "lblTileLayout";
this.lblTileLayout.Size = new System.Drawing.Size(62, 13);
this.lblTileLayout.TabIndex = 18;
this.lblTileLayout.Text = "Tile Layout:";
//
// cboLayout
//
this.cboLayout.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboLayout.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboLayout.FormattingEnabled = true;
this.cboLayout.Items.AddRange(new object[] {
"2 BPP",
"4 BPP",
"8 BPP",
"8 BPP - Direct Color Mode",
"Mode 7",
"Mode 7 - Direct Color Mode"});
this.cboLayout.Location = new System.Drawing.Point(77, 57);
this.cboLayout.Name = "cboLayout";
this.cboLayout.Size = new System.Drawing.Size(114, 21);
this.cboLayout.TabIndex = 19;
//
// ctrlImagePanel
//
this.ctrlImagePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlImagePanel.GridSizeX = 0;
this.ctrlImagePanel.GridSizeY = 0;
this.ctrlImagePanel.Image = null;
this.ctrlImagePanel.ImageScale = 1;
this.ctrlImagePanel.ImageSize = new System.Drawing.Size(0, 0);
this.ctrlImagePanel.Location = new System.Drawing.Point(3, 3);
this.ctrlImagePanel.Name = "ctrlImagePanel";
this.ctrlImagePanel.Overlay = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ctrlImagePanel.Selection = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ctrlImagePanel.SelectionWrapPosition = 0;
this.ctrlImagePanel.Size = new System.Drawing.Size(531, 516);
@ -478,6 +511,9 @@
// mnuFile
//
this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuCopyToClipboard,
this.mnuSaveAsPng,
this.toolStripMenuItem3,
this.mnuClose});
this.mnuFile.Name = "mnuFile";
this.mnuFile.Size = new System.Drawing.Size(37, 20);
@ -487,7 +523,7 @@
//
this.mnuClose.Image = global::Mesen.GUI.Properties.Resources.Exit;
this.mnuClose.Name = "mnuClose";
this.mnuClose.Size = new System.Drawing.Size(103, 22);
this.mnuClose.Size = new System.Drawing.Size(169, 22);
this.mnuClose.Text = "Close";
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
//
@ -545,32 +581,24 @@
this.mnuZoomOut.Text = "Zoom Out";
this.mnuZoomOut.Click += new System.EventHandler(this.mnuZoomOut_Click);
//
// lblTileLayout
// mnuCopyToClipboard
//
this.lblTileLayout.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblTileLayout.AutoSize = true;
this.lblTileLayout.Location = new System.Drawing.Point(3, 61);
this.lblTileLayout.Name = "lblTileLayout";
this.lblTileLayout.Size = new System.Drawing.Size(62, 13);
this.lblTileLayout.TabIndex = 18;
this.lblTileLayout.Text = "Tile Layout:";
this.mnuCopyToClipboard.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopyToClipboard.Name = "mnuCopyToClipboard";
this.mnuCopyToClipboard.Size = new System.Drawing.Size(169, 22);
this.mnuCopyToClipboard.Text = "Copy to clipboard";
//
// cboLayout
// mnuSaveAsPng
//
this.cboLayout.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboLayout.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboLayout.FormattingEnabled = true;
this.cboLayout.Items.AddRange(new object[] {
"2 BPP",
"4 BPP",
"8 BPP",
"8 BPP - Direct Color Mode",
"Mode 7",
"Mode 7 - Direct Color Mode"});
this.cboLayout.Location = new System.Drawing.Point(77, 57);
this.cboLayout.Name = "cboLayout";
this.cboLayout.Size = new System.Drawing.Size(114, 21);
this.cboLayout.TabIndex = 19;
this.mnuSaveAsPng.Image = global::Mesen.GUI.Properties.Resources.Export;
this.mnuSaveAsPng.Name = "mnuSaveAsPng";
this.mnuSaveAsPng.Size = new System.Drawing.Size(169, 22);
this.mnuSaveAsPng.Text = "Save as PNG";
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(166, 6);
//
// frmTileViewer
//
@ -638,5 +666,8 @@
private System.Windows.Forms.TextBox txtTileAddress;
private System.Windows.Forms.Label lblTileLayout;
private System.Windows.Forms.ComboBox cboLayout;
private System.Windows.Forms.ToolStripMenuItem mnuCopyToClipboard;
private System.Windows.Forms.ToolStripMenuItem mnuSaveAsPng;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
}
}

View file

@ -113,6 +113,12 @@ namespace Mesen.GUI.Debugger
mnuRefresh.InitShortcut(this, nameof(DebuggerShortcutsConfig.Refresh));
mnuZoomIn.InitShortcut(this, nameof(DebuggerShortcutsConfig.ZoomIn));
mnuZoomOut.InitShortcut(this, nameof(DebuggerShortcutsConfig.ZoomOut));
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
mnuSaveAsPng.InitShortcut(this, nameof(DebuggerShortcutsConfig.SaveAsPng));
mnuCopyToClipboard.Click += (s, e) => { ctrlImagePanel.CopyToClipboard(); };
mnuSaveAsPng.Click += (s, e) => { ctrlImagePanel.SaveAsPng(); };
}
protected override void OnFormClosed(FormClosedEventArgs e)

View file

@ -78,6 +78,9 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.mnuZoomIn = new System.Windows.Forms.ToolStripMenuItem();
this.mnuZoomOut = new System.Windows.Forms.ToolStripMenuItem();
this.mnuSaveAsPng = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
this.mnuCopyToClipboard = new System.Windows.Forms.ToolStripMenuItem();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.grpTileInfo.SuspendLayout();
@ -561,12 +564,16 @@
// ctrlImagePanel
//
this.ctrlImagePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlImagePanel.GridSizeX = 0;
this.ctrlImagePanel.GridSizeY = 0;
this.ctrlImagePanel.Image = null;
this.ctrlImagePanel.ImageScale = 1;
this.ctrlImagePanel.ImageSize = new System.Drawing.Size(0, 0);
this.ctrlImagePanel.Location = new System.Drawing.Point(3, 31);
this.ctrlImagePanel.Name = "ctrlImagePanel";
this.ctrlImagePanel.Overlay = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ctrlImagePanel.Selection = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ctrlImagePanel.SelectionWrapPosition = 0;
this.ctrlImagePanel.Size = new System.Drawing.Size(513, 474);
this.ctrlImagePanel.TabIndex = 9;
this.ctrlImagePanel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ctrlImagePanel_MouseClick);
@ -585,6 +592,9 @@
// mnuFile
//
this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuCopyToClipboard,
this.mnuSaveAsPng,
this.toolStripMenuItem3,
this.mnuClose});
this.mnuFile.Name = "mnuFile";
this.mnuFile.Size = new System.Drawing.Size(37, 20);
@ -594,7 +604,7 @@
//
this.mnuClose.Image = global::Mesen.GUI.Properties.Resources.Exit;
this.mnuClose.Name = "mnuClose";
this.mnuClose.Size = new System.Drawing.Size(103, 22);
this.mnuClose.Size = new System.Drawing.Size(169, 22);
this.mnuClose.Text = "Close";
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
//
@ -617,42 +627,61 @@
this.mnuAutoRefresh.CheckOnClick = true;
this.mnuAutoRefresh.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnuAutoRefresh.Name = "mnuAutoRefresh";
this.mnuAutoRefresh.Size = new System.Drawing.Size(152, 22);
this.mnuAutoRefresh.Size = new System.Drawing.Size(141, 22);
this.mnuAutoRefresh.Text = "Auto-refresh";
this.mnuAutoRefresh.CheckedChanged += new System.EventHandler(this.mnuAutoRefresh_CheckedChanged);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem2.Size = new System.Drawing.Size(138, 6);
//
// mnuRefresh
//
this.mnuRefresh.Image = global::Mesen.GUI.Properties.Resources.Refresh;
this.mnuRefresh.Name = "mnuRefresh";
this.mnuRefresh.Size = new System.Drawing.Size(152, 22);
this.mnuRefresh.Size = new System.Drawing.Size(141, 22);
this.mnuRefresh.Text = "Refresh";
this.mnuRefresh.Click += new System.EventHandler(this.mnuRefresh_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(138, 6);
//
// mnuZoomIn
//
this.mnuZoomIn.Name = "mnuZoomIn";
this.mnuZoomIn.Size = new System.Drawing.Size(152, 22);
this.mnuZoomIn.Size = new System.Drawing.Size(141, 22);
this.mnuZoomIn.Text = "Zoom In";
this.mnuZoomIn.Click += new System.EventHandler(this.mnuZoomIn_Click);
//
// mnuZoomOut
//
this.mnuZoomOut.Name = "mnuZoomOut";
this.mnuZoomOut.Size = new System.Drawing.Size(152, 22);
this.mnuZoomOut.Size = new System.Drawing.Size(141, 22);
this.mnuZoomOut.Text = "Zoom Out";
this.mnuZoomOut.Click += new System.EventHandler(this.mnuZoomOut_Click);
//
// mnuSaveAsPng
//
this.mnuSaveAsPng.Image = global::Mesen.GUI.Properties.Resources.Export;
this.mnuSaveAsPng.Name = "mnuSaveAsPng";
this.mnuSaveAsPng.Size = new System.Drawing.Size(169, 22);
this.mnuSaveAsPng.Text = "Save as PNG";
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(166, 6);
//
// mnuCopyToClipboard
//
this.mnuCopyToClipboard.Image = global::Mesen.GUI.Properties.Resources.Copy;
this.mnuCopyToClipboard.Name = "mnuCopyToClipboard";
this.mnuCopyToClipboard.Size = new System.Drawing.Size(169, 22);
this.mnuCopyToClipboard.Text = "Copy to clipboard";
//
// frmTilemapViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -664,6 +693,9 @@
this.MainMenuStrip = this.ctrlMesenMenuStrip1;
this.Name = "frmTilemapViewer";
this.Text = "Tilemap Viewer";
this.Controls.SetChildIndex(this.ctrlMesenMenuStrip1, 0);
this.Controls.SetChildIndex(this.ctrlScanlineCycleSelect, 0);
this.Controls.SetChildIndex(this.tableLayoutPanel1, 0);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
@ -734,5 +766,8 @@
private System.Windows.Forms.TextBox txtTilesetAddress;
private System.Windows.Forms.TextBox txtBitDepth;
private PpuViewer.ctrlImagePanel ctrlImagePanel;
private System.Windows.Forms.ToolStripMenuItem mnuCopyToClipboard;
private System.Windows.Forms.ToolStripMenuItem mnuSaveAsPng;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
}
}

View file

@ -77,6 +77,12 @@ namespace Mesen.GUI.Debugger
mnuRefresh.InitShortcut(this, nameof(DebuggerShortcutsConfig.Refresh));
mnuZoomIn.InitShortcut(this, nameof(DebuggerShortcutsConfig.ZoomIn));
mnuZoomOut.InitShortcut(this, nameof(DebuggerShortcutsConfig.ZoomOut));
mnuCopyToClipboard.InitShortcut(this, nameof(DebuggerShortcutsConfig.Copy));
mnuSaveAsPng.InitShortcut(this, nameof(DebuggerShortcutsConfig.SaveAsPng));
mnuCopyToClipboard.Click += (s, e) => { ctrlImagePanel.CopyToClipboard(); };
mnuSaveAsPng.Click += (s, e) => { ctrlImagePanel.SaveAsPng(); };
}
protected override void OnFormClosed(FormClosedEventArgs e)

View file

@ -25,6 +25,7 @@ namespace Mesen.GUI.Debugger
GetMember(nameof(DebuggerShortcutsConfig.ResetFontSize)),
GetMember(nameof(DebuggerShortcutsConfig.ZoomIn)),
GetMember(nameof(DebuggerShortcutsConfig.ZoomOut)),
GetMember(nameof(DebuggerShortcutsConfig.SaveAsPng)),
GetMember(nameof(DebuggerShortcutsConfig.GoTo)),
GetMember(nameof(DebuggerShortcutsConfig.Find)),
GetMember(nameof(DebuggerShortcutsConfig.FindNext)),
@ -71,12 +72,12 @@ namespace Mesen.GUI.Debugger
//GetMember(nameof(DebuggerShortcutsConfig.MemoryViewer_ViewInMemoryType))
};
/*ctrlDbgShortcutsScriptWindow.Shortcuts = new FieldInfo[] {
ctrlDbgShortcutsScriptWindow.Shortcuts = new FieldInfo[] {
GetMember(nameof(DebuggerShortcutsConfig.ScriptWindow_OpenScript)),
GetMember(nameof(DebuggerShortcutsConfig.ScriptWindow_SaveScript)),
GetMember(nameof(DebuggerShortcutsConfig.ScriptWindow_RunScript)),
GetMember(nameof(DebuggerShortcutsConfig.ScriptWindow_StopScript))
};*/
};
ctrlDbgShortcutsDebugger.Shortcuts = new FieldInfo[] {
GetMember(nameof(DebuggerShortcutsConfig.Reset)),