summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-05-21 23:26:25 +0000
committerIan C <ianc@noddybox.co.uk>2005-05-21 23:26:25 +0000
commit9a66f9371393fc793f8427749e167400dff99bb5 (patch)
tree460630472304f3035c8378dbe82983f61ad6fa58
parent326ebe083338e53e261a513418a418413a63bd2f (diff)
Fixed transparent paste. Added highlight for low colours.
-rw-r--r--BitmapFontEd.GfxEditor.resourcesbin14416 -> 14416 bytes
-rw-r--r--GfxEditor.cs109
2 files changed, 68 insertions, 41 deletions
diff --git a/BitmapFontEd.GfxEditor.resources b/BitmapFontEd.GfxEditor.resources
index 01b0eb4..32fce11 100644
--- a/BitmapFontEd.GfxEditor.resources
+++ b/BitmapFontEd.GfxEditor.resources
Binary files differ
diff --git a/GfxEditor.cs b/GfxEditor.cs
index 514fa62..cf096f6 100644
--- a/GfxEditor.cs
+++ b/GfxEditor.cs
@@ -38,20 +38,21 @@ namespace BitmapFontEd
private System.Windows.Forms.Label m_recent8;
private System.Windows.Forms.Label m_recent1;
private System.Windows.Forms.Label label11;
- private System.Windows.Forms.Label m_recent4;
+ private System.Windows.Forms.Label m_recent3;
private System.Windows.Forms.Label m_recent5;
private System.Windows.Forms.Label m_recent6;
private System.Windows.Forms.Label m_recent7;
private System.Windows.Forms.Label m_bgPreview;
private System.Windows.Forms.Label m_recent2;
- private System.Windows.Forms.Label m_recent3;
- private System.Windows.Forms.PictureBox m_preview;
private System.Windows.Forms.NumericUpDown m_sizeY;
+ private System.Windows.Forms.CheckBox m_mark;
+ private System.Windows.Forms.PictureBox m_preview;
private System.Windows.Forms.Label m_gridCol;
private System.Windows.Forms.PictureBox m_edit;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label m_pos;
+ private System.Windows.Forms.Label m_recent4;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Button m_undoButton;
@@ -178,20 +179,21 @@ namespace BitmapFontEd
this.m_undoButton = new System.Windows.Forms.Button();
this.label15 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
+ this.m_recent4 = new System.Windows.Forms.Label();
this.m_pos = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.m_edit = new System.Windows.Forms.PictureBox();
this.m_gridCol = new System.Windows.Forms.Label();
- this.m_sizeY = new System.Windows.Forms.NumericUpDown();
this.m_preview = new System.Windows.Forms.PictureBox();
- this.m_recent3 = new System.Windows.Forms.Label();
+ this.m_mark = new System.Windows.Forms.CheckBox();
+ this.m_sizeY = new System.Windows.Forms.NumericUpDown();
this.m_recent2 = new System.Windows.Forms.Label();
this.m_bgPreview = new System.Windows.Forms.Label();
this.m_recent7 = new System.Windows.Forms.Label();
this.m_recent6 = new System.Windows.Forms.Label();
this.m_recent5 = new System.Windows.Forms.Label();
- this.m_recent4 = new System.Windows.Forms.Label();
+ this.m_recent3 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.m_recent1 = new System.Windows.Forms.Label();
this.m_recent8 = new System.Windows.Forms.Label();
@@ -213,7 +215,7 @@ namespace BitmapFontEd
//
// label4
//
- this.label4.Location = new System.Drawing.Point(280, 96);
+ this.label4.Location = new System.Drawing.Point(280, 88);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(32, 16);
this.label4.TabIndex = 10;
@@ -222,7 +224,7 @@ namespace BitmapFontEd
//
// label5
//
- this.label5.Location = new System.Drawing.Point(336, 96);
+ this.label5.Location = new System.Drawing.Point(336, 88);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(40, 16);
this.label5.TabIndex = 12;
@@ -284,7 +286,7 @@ namespace BitmapFontEd
//
// label2
//
- this.label2.Location = new System.Drawing.Point(280, 160);
+ this.label2.Location = new System.Drawing.Point(280, 168);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 16);
this.label2.TabIndex = 21;
@@ -323,6 +325,16 @@ namespace BitmapFontEd
this.label14.Size = new System.Drawing.Size(16, 16);
this.label14.TabIndex = 29;
//
+ // m_recent4
+ //
+ this.m_recent4.BackColor = System.Drawing.Color.Black;
+ this.m_recent4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.m_recent4.Location = new System.Drawing.Point(352, 248);
+ this.m_recent4.Name = "m_recent4";
+ this.m_recent4.Size = new System.Drawing.Size(16, 16);
+ this.m_recent4.TabIndex = 28;
+ this.m_recent4.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent);
+ //
// m_pos
//
this.m_pos.Location = new System.Drawing.Point(208, 272);
@@ -371,6 +383,26 @@ namespace BitmapFontEd
this.m_gridCol.TabIndex = 33;
this.m_gridCol.Click += new System.EventHandler(this.OnGrid);
//
+ // m_preview
+ //
+ this.m_preview.BackColor = System.Drawing.SystemColors.Control;
+ this.m_preview.Location = new System.Drawing.Point(288, 192);
+ this.m_preview.Name = "m_preview";
+ this.m_preview.Size = new System.Drawing.Size(34, 34);
+ this.m_preview.TabIndex = 1;
+ this.m_preview.TabStop = false;
+ //
+ // m_mark
+ //
+ this.m_mark.Checked = true;
+ this.m_mark.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.m_mark.Location = new System.Drawing.Point(280, 136);
+ this.m_mark.Name = "m_mark";
+ this.m_mark.Size = new System.Drawing.Size(96, 32);
+ this.m_mark.TabIndex = 35;
+ this.m_mark.Text = "Highlight Dark Colours";
+ this.m_mark.CheckedChanged += new System.EventHandler(this.OnMark);
+ //
// m_sizeY
//
this.m_sizeY.CausesValidation = false;
@@ -397,25 +429,6 @@ namespace BitmapFontEd
this.m_sizeY.ValueChanged += new System.EventHandler(this.OnSizeHeight);
this.m_sizeY.Leave += new System.EventHandler(this.OnSizeHeight);
//
- // m_preview
- //
- this.m_preview.BackColor = System.Drawing.SystemColors.Control;
- this.m_preview.Location = new System.Drawing.Point(288, 184);
- this.m_preview.Name = "m_preview";
- this.m_preview.Size = new System.Drawing.Size(34, 34);
- this.m_preview.TabIndex = 1;
- this.m_preview.TabStop = false;
- //
- // m_recent3
- //
- this.m_recent3.BackColor = System.Drawing.Color.Black;
- this.m_recent3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.m_recent3.Location = new System.Drawing.Point(328, 248);
- this.m_recent3.Name = "m_recent3";
- this.m_recent3.Size = new System.Drawing.Size(16, 16);
- this.m_recent3.TabIndex = 27;
- this.m_recent3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent);
- //
// m_recent2
//
this.m_recent2.BackColor = System.Drawing.Color.Black;
@@ -430,9 +443,9 @@ namespace BitmapFontEd
//
this.m_bgPreview.BackColor = System.Drawing.Color.Transparent;
this.m_bgPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.m_bgPreview.Location = new System.Drawing.Point(336, 112);
+ this.m_bgPreview.Location = new System.Drawing.Point(336, 104);
this.m_bgPreview.Name = "m_bgPreview";
- this.m_bgPreview.Size = new System.Drawing.Size(40, 40);
+ this.m_bgPreview.Size = new System.Drawing.Size(40, 32);
this.m_bgPreview.TabIndex = 18;
this.m_bgPreview.Click += new System.EventHandler(this.OnBackground);
//
@@ -466,15 +479,15 @@ namespace BitmapFontEd
this.m_recent5.TabIndex = 29;
this.m_recent5.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent);
//
- // m_recent4
+ // m_recent3
//
- this.m_recent4.BackColor = System.Drawing.Color.Black;
- this.m_recent4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.m_recent4.Location = new System.Drawing.Point(352, 248);
- this.m_recent4.Name = "m_recent4";
- this.m_recent4.Size = new System.Drawing.Size(16, 16);
- this.m_recent4.TabIndex = 28;
- this.m_recent4.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent);
+ this.m_recent3.BackColor = System.Drawing.Color.Black;
+ this.m_recent3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.m_recent3.Location = new System.Drawing.Point(328, 248);
+ this.m_recent3.Name = "m_recent3";
+ this.m_recent3.Size = new System.Drawing.Size(16, 16);
+ this.m_recent3.TabIndex = 27;
+ this.m_recent3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnRecent);
//
// label11
//
@@ -529,14 +542,15 @@ namespace BitmapFontEd
//
this.m_fgPreview.BackColor = System.Drawing.Color.White;
this.m_fgPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.m_fgPreview.Location = new System.Drawing.Point(280, 112);
+ this.m_fgPreview.Location = new System.Drawing.Point(280, 104);
this.m_fgPreview.Name = "m_fgPreview";
- this.m_fgPreview.Size = new System.Drawing.Size(40, 40);
+ this.m_fgPreview.Size = new System.Drawing.Size(40, 32);
this.m_fgPreview.TabIndex = 17;
this.m_fgPreview.Click += new System.EventHandler(this.OnForeground);
//
// GfxEditor
//
+ this.Controls.Add(this.m_mark);
this.Controls.Add(this.m_backCol);
this.Controls.Add(this.m_gridCol);
this.Controls.Add(this.m_recent8);
@@ -729,6 +743,14 @@ namespace BitmapFontEd
edit.FillRectangle(p,gx,gy,gw,gw);
prev.FillRectangle(p,1+x,1+y,1,1);
+
+ if (m_mark.Checked)
+ {
+ if ((c.R<100 && c.G<100 && c.B<100 && c.A>0) || (c.A>0 && c.A<100))
+ {
+ edit.DrawRectangle(Pens.White,gx+1,gy+1,gw-3,gw-3);
+ }
+ }
}
#endregion
@@ -857,7 +879,7 @@ namespace BitmapFontEd
for(int w=0;w<m_cpWidth;w++)
for(int h=0;h<m_cpHeight;h++)
- if (!trans || m_cpBuff[w,h]!=m_bgPreview.BackColor)
+ if (!trans || m_cpBuff[w,h].A!=0)
SafePlot(x+w,y+h,m_cpBuff[w,h]);
}
@@ -1383,6 +1405,11 @@ namespace BitmapFontEd
}
}
+ void OnMark(object sender, System.EventArgs e)
+ {
+ RedrawChar();
+ }
+
#endregion
}
}