Linux: Fixed most layout issues with Mono

This commit is contained in:
Souryo 2016-12-13 22:19:18 -05:00
parent 68b45dc951
commit a0e44427bd
12 changed files with 41 additions and 23 deletions

View file

@ -89,7 +89,7 @@
this.grpTileInfo.Dock = System.Windows.Forms.DockStyle.Top;
this.grpTileInfo.Location = new System.Drawing.Point(267, 3);
this.grpTileInfo.Name = "grpTileInfo";
this.grpTileInfo.Size = new System.Drawing.Size(264, 142);
this.grpTileInfo.Size = new System.Drawing.Size(264, 152);
this.grpTileInfo.TabIndex = 4;
this.grpTileInfo.TabStop = false;
this.grpTileInfo.Text = "Tile Info";

View file

@ -56,8 +56,8 @@ namespace Mesen.GUI.Debugger.Controls
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
g.Clear(Color.Black);
g.DrawImage(source, new Rectangle(0, 0, 256, 256), new Rectangle(0, 0, 128, 128), GraphicsUnit.Pixel);
g.ScaleTransform(2, 2);
g.DrawImageUnscaled(source, 0, 0);
}
chrBanks[i].Image = target;
} finally {
@ -142,11 +142,16 @@ namespace Mesen.GUI.Debugger.Controls
this.txtTileAddress.Text = (baseAddress + tileIndex * 16).ToString("X4");
Bitmap tile = new Bitmap(64, 64);
Bitmap tilePreview = new Bitmap(16, 16);
using(Graphics g = Graphics.FromImage(tilePreview)) {
g.DrawImage(((PictureBox)sender).Image, new Rectangle(0, 0, 16, 16), new Rectangle(tileX*16, tileY*16, 16, 16), GraphicsUnit.Pixel);
}
using(Graphics g = Graphics.FromImage(tile)) {
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
g.DrawImage(((PictureBox)sender).Image, new Rectangle(0, 0, 64, 64), new Rectangle(tileX*16, tileY*16, 16, 16), GraphicsUnit.Pixel);
g.ScaleTransform(4, 4);
g.DrawImageUnscaled(tilePreview, 0, 0);
}
this.picTile.Image = tile;
}

View file

@ -150,16 +150,14 @@
this.tableLayoutPanel2.RowCount = 3;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(470, 391);
this.tableLayoutPanel2.TabIndex = 2;
//
// grpPPUStatus
//
this.grpPPUStatus.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.grpPPUStatus.Controls.Add(this.tableLayoutPanel8);
this.grpPPUStatus.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpPPUStatus.Location = new System.Drawing.Point(3, 180);
this.grpPPUStatus.Name = "grpPPUStatus";
this.grpPPUStatus.Size = new System.Drawing.Size(464, 179);

View file

@ -104,7 +104,7 @@
this.flowLayoutPanel2.Controls.Add(this.cboSort);
this.flowLayoutPanel2.Location = new System.Drawing.Point(335, 3);
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(176, 26);
this.flowLayoutPanel2.Size = new System.Drawing.Size(182, 26);
this.flowLayoutPanel2.TabIndex = 3;
//
// lblSort

View file

@ -90,7 +90,7 @@
this.grpTileInfo.Controls.Add(this.tableLayoutPanel2);
this.grpTileInfo.Location = new System.Drawing.Point(519, 3);
this.grpTileInfo.Name = "grpTileInfo";
this.grpTileInfo.Size = new System.Drawing.Size(175, 224);
this.grpTileInfo.Size = new System.Drawing.Size(175, 238);
this.grpTileInfo.TabIndex = 4;
this.grpTileInfo.TabStop = false;
this.grpTileInfo.Text = "Tile Info";
@ -196,7 +196,7 @@
this.lblAttributeAddress.Name = "lblAttributeAddress";
this.lblAttributeAddress.Size = new System.Drawing.Size(90, 13);
this.lblAttributeAddress.TabIndex = 3;
this.lblAttributeAddress.Text = "Attribute Address:";
this.lblAttributeAddress.Text = "Attribute Addr:";
//
// lblPaletteAddress
//
@ -206,7 +206,7 @@
this.lblPaletteAddress.Name = "lblPaletteAddress";
this.lblPaletteAddress.Size = new System.Drawing.Size(84, 13);
this.lblPaletteAddress.TabIndex = 4;
this.lblPaletteAddress.Text = "Palette Address:";
this.lblPaletteAddress.Text = "Palette Addr:";
//
// lblTile
//

View file

@ -166,11 +166,16 @@ namespace Mesen.GUI.Debugger.Controls
this.txtPaletteAddress.Text = (0x3F00 + paletteBaseAddr).ToString("X4");
Bitmap tile = new Bitmap(64, 64);
Bitmap tilePreview = new Bitmap(8, 8);
using(Graphics g = Graphics.FromImage(tilePreview)) {
g.DrawImage(_nametableImage, new Rectangle(0, 0, 8, 8), new Rectangle(e.X/8*8, e.Y/8*8, 8, 8), GraphicsUnit.Pixel);
}
using(Graphics g = Graphics.FromImage(tile)) {
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
g.DrawImage(_nametableImage, new Rectangle(0, 0, 64, 64), new Rectangle(e.X/8*8, e.Y/8*8, 8, 8), GraphicsUnit.Pixel);
g.ScaleTransform(8, 8);
g.DrawImageUnscaled(tilePreview, 0, 0);
}
this.picTile.Image = tile;
}

View file

@ -44,7 +44,8 @@ namespace Mesen.GUI.Debugger.Controls
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
g.DrawImage(source, new Rectangle(0, 0, 128, 256), new Rectangle(0, 0, 4, 8), GraphicsUnit.Pixel);
g.ScaleTransform(32, 32);
g.DrawImageUnscaled(source, 0, 0);
}
this.picPalette.Image = target;
} finally {

View file

@ -51,7 +51,9 @@ namespace Mesen.GUI.Debugger.Controls
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
g.DrawImage(source, new Rectangle(0, 0, 256, 512), new Rectangle(0, 0, 64, 128), GraphicsUnit.Pixel);
g.ScaleTransform(4, 4);
g.DrawImageUnscaled(source, 0, 0);
}
picSprites.Image = target;
} finally {
@ -142,11 +144,16 @@ namespace Mesen.GUI.Debugger.Controls
this.chkBackgroundPriority.Checked = backgroundPriority;
Bitmap tile = new Bitmap(64, 128);
Bitmap tilePreview = new Bitmap(8, 16);
using(Graphics g = Graphics.FromImage(tilePreview)) {
g.DrawImage(((PictureBox)sender).Image, new Rectangle(0, 0, 8, 16), new Rectangle(tileX*32, tileY*64, 32, 64), GraphicsUnit.Pixel);
}
using(Graphics g = Graphics.FromImage(tile)) {
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
g.DrawImage(((PictureBox)sender).Image, new Rectangle(0, 0, 64, 128), new Rectangle(tileX*32, tileY*64, 32, 64), GraphicsUnit.Pixel);
g.ScaleTransform(8, 8);
g.DrawImageUnscaled(tilePreview, 0, 0);
}
this.picTile.Image = tile;

View file

@ -87,7 +87,7 @@
//
this.flowLayoutPanel1.Controls.Add(this.lblViewMemoryType);
this.flowLayoutPanel1.Controls.Add(this.cboMemoryType);
this.flowLayoutPanel1.Location = new System.Drawing.Point(6, 31);
this.flowLayoutPanel1.Location = new System.Drawing.Point(6, 27);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(167, 27);
this.flowLayoutPanel1.TabIndex = 1;

View file

@ -891,8 +891,7 @@
//
this.tableLayoutPanel3.ColumnCount = 2;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel3.Controls.Add(this.picPalette, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel2, 1, 1);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
@ -911,7 +910,7 @@
this.picPalette.Location = new System.Drawing.Point(1, 1);
this.picPalette.Margin = new System.Windows.Forms.Padding(1);
this.picPalette.Name = "picPalette";
this.picPalette.Size = new System.Drawing.Size(386, 98);
this.picPalette.Size = new System.Drawing.Size(352, 88);
this.picPalette.TabIndex = 0;
this.picPalette.TabStop = false;
this.picPalette.MouseDown += new System.Windows.Forms.MouseEventHandler(this.picPalette_MouseDown);
@ -923,6 +922,7 @@
this.tableLayoutPanel2.Controls.Add(this.btnExportPalette, 0, 2);
this.tableLayoutPanel2.Controls.Add(this.btnSelectPalette, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.btnLoadPalFile, 0, 1);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(388, 0);
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";

View file

@ -102,7 +102,8 @@ namespace Mesen.GUI.Forms.Config
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
g.DrawImage(source, new Rectangle(0, 0, 384, 96), new Rectangle(0, 0, 16, 4), GraphicsUnit.Pixel);
g.ScaleTransform(22, 22);
g.DrawImageUnscaled(source, 0, 0);
}
this.picPalette.Image = target;
} finally {
@ -112,7 +113,7 @@ namespace Mesen.GUI.Forms.Config
private void picPalette_MouseDown(object sender, MouseEventArgs e)
{
int offset = (e.X / 24) + (e.Y / 24 * 16);
int offset = (e.X / 22) + (e.Y / 22 * 16);
colorDialog.SolidColorOnly = true;
colorDialog.AllowFullOpen = true;

View file

@ -70,6 +70,7 @@
//
this.logoPictureBox.Image = global::Mesen.GUI.Properties.Resources.MesenLogo;
this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
this.logoPictureBox.Margin = new System.Windows.Forms.Padding(0, 0, 0, 5);
this.logoPictureBox.Name = "logoPictureBox";
this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 4);
this.logoPictureBox.Size = new System.Drawing.Size(64, 65);