diff options
-rw-r--r-- | AlphaColourDialog.cs | 94 | ||||
-rw-r--r-- | BitmapSpriteEd.AlphaColourDialog.resources | bin | 0 -> 12343 bytes | |||
-rw-r--r-- | BitmapSpriteEd.prjx | 9 |
3 files changed, 64 insertions, 39 deletions
diff --git a/AlphaColourDialog.cs b/AlphaColourDialog.cs index 1cecf40..a36b2de 100644 --- a/AlphaColourDialog.cs +++ b/AlphaColourDialog.cs @@ -29,15 +29,15 @@ namespace BitmapSpriteEd /// </summary>
public class AlphaColourDialog : System.Windows.Forms.Form
{
- private System.Windows.Forms.Label m_common7;
+ private System.Windows.Forms.ComboBox m_named;
private System.Windows.Forms.Label m_common4;
- private System.Windows.Forms.Label m_common5;
private System.Windows.Forms.Label m_common3;
+ private System.Windows.Forms.Label m_common5;
private System.Windows.Forms.TextBox m_red;
+ private System.Windows.Forms.Label m_common7;
private System.Windows.Forms.TrackBar m_greenSlider;
private System.Windows.Forms.TextBox m_alpha;
private System.Windows.Forms.Label m_preview;
- private System.Windows.Forms.ComboBox m_named;
private System.Windows.Forms.TrackBar m_redSlider;
private System.Windows.Forms.TrackBar m_alphaSlider;
private System.Windows.Forms.Label label1;
@@ -150,15 +150,15 @@ namespace BitmapSpriteEd this.label1 = new System.Windows.Forms.Label();
this.m_alphaSlider = new System.Windows.Forms.TrackBar();
this.m_redSlider = new System.Windows.Forms.TrackBar();
- this.m_named = new System.Windows.Forms.ComboBox();
this.m_preview = new System.Windows.Forms.Label();
this.m_alpha = new System.Windows.Forms.TextBox();
this.m_greenSlider = new System.Windows.Forms.TrackBar();
+ this.m_common7 = new System.Windows.Forms.Label();
this.m_red = new System.Windows.Forms.TextBox();
- this.m_common3 = new System.Windows.Forms.Label();
this.m_common5 = new System.Windows.Forms.Label();
+ this.m_common3 = new System.Windows.Forms.Label();
this.m_common4 = new System.Windows.Forms.Label();
- this.m_common7 = new System.Windows.Forms.Label();
+ this.m_named = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.m_blueSlider)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.m_alphaSlider)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.m_redSlider)).BeginInit();
@@ -329,17 +329,6 @@ namespace BitmapSpriteEd this.m_redSlider.TickFrequency = 5;
this.m_redSlider.Scroll += new System.EventHandler(this.OnRed);
//
- // m_named
- //
- this.m_named.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.m_named.Location = new System.Drawing.Point(8, 296);
- this.m_named.MaxDropDownItems = 20;
- this.m_named.Name = "m_named";
- this.m_named.Size = new System.Drawing.Size(168, 21);
- this.m_named.Sorted = true;
- this.m_named.TabIndex = 25;
- this.m_named.SelectedIndexChanged += new System.EventHandler(this.OnNamedColour);
- //
// m_preview
//
this.m_preview.BackColor = System.Drawing.Color.Black;
@@ -348,6 +337,9 @@ namespace BitmapSpriteEd this.m_preview.Name = "m_preview";
this.m_preview.Size = new System.Drawing.Size(168, 168);
this.m_preview.TabIndex = 14;
+ this.m_preview.Text = "Click Here to use standard Windows Colour Picker";
+ this.m_preview.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ this.m_preview.Click += new System.EventHandler(this.OnSelectColour);
//
// m_alpha
//
@@ -370,6 +362,16 @@ namespace BitmapSpriteEd this.m_greenSlider.TickFrequency = 5;
this.m_greenSlider.Scroll += new System.EventHandler(this.OnGreen);
//
+ // m_common7
+ //
+ this.m_common7.BackColor = System.Drawing.Color.Fuchsia;
+ this.m_common7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.m_common7.Location = new System.Drawing.Point(96, 240);
+ this.m_common7.Name = "m_common7";
+ this.m_common7.Size = new System.Drawing.Size(24, 24);
+ this.m_common7.TabIndex = 22;
+ this.m_common7.Click += new System.EventHandler(this.OnCommon);
+ //
// m_red
//
this.m_red.Location = new System.Drawing.Point(192, 296);
@@ -380,16 +382,6 @@ namespace BitmapSpriteEd this.m_red.TabIndex = 8;
this.m_red.Text = "textBox1";
//
- // m_common3
- //
- this.m_common3.BackColor = System.Drawing.Color.Red;
- this.m_common3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.m_common3.Location = new System.Drawing.Point(96, 208);
- this.m_common3.Name = "m_common3";
- this.m_common3.Size = new System.Drawing.Size(24, 24);
- this.m_common3.TabIndex = 18;
- this.m_common3.Click += new System.EventHandler(this.OnCommon);
- //
// m_common5
//
this.m_common5.BackColor = System.Drawing.Color.Blue;
@@ -400,6 +392,16 @@ namespace BitmapSpriteEd this.m_common5.TabIndex = 20;
this.m_common5.Click += new System.EventHandler(this.OnCommon);
//
+ // m_common3
+ //
+ this.m_common3.BackColor = System.Drawing.Color.Red;
+ this.m_common3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.m_common3.Location = new System.Drawing.Point(96, 208);
+ this.m_common3.Name = "m_common3";
+ this.m_common3.Size = new System.Drawing.Size(24, 24);
+ this.m_common3.TabIndex = 18;
+ this.m_common3.Click += new System.EventHandler(this.OnCommon);
+ //
// m_common4
//
this.m_common4.BackColor = System.Drawing.Color.Lime;
@@ -410,15 +412,16 @@ namespace BitmapSpriteEd this.m_common4.TabIndex = 19;
this.m_common4.Click += new System.EventHandler(this.OnCommon);
//
- // m_common7
+ // m_named
//
- this.m_common7.BackColor = System.Drawing.Color.Fuchsia;
- this.m_common7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.m_common7.Location = new System.Drawing.Point(96, 240);
- this.m_common7.Name = "m_common7";
- this.m_common7.Size = new System.Drawing.Size(24, 24);
- this.m_common7.TabIndex = 22;
- this.m_common7.Click += new System.EventHandler(this.OnCommon);
+ this.m_named.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.m_named.Location = new System.Drawing.Point(8, 296);
+ this.m_named.MaxDropDownItems = 20;
+ this.m_named.Name = "m_named";
+ this.m_named.Size = new System.Drawing.Size(168, 21);
+ this.m_named.Sorted = true;
+ this.m_named.TabIndex = 25;
+ this.m_named.SelectedIndexChanged += new System.EventHandler(this.OnNamedColour);
//
// AlphaColourDialog
//
@@ -505,5 +508,26 @@ namespace BitmapSpriteEd Color=Color.FromKnownColor((KnownColor)Enum.Parse(typeof(KnownColor),s));
}
+ void OnSelectColour(object sender, System.EventArgs e)
+ {
+ ColorDialog dlg=new ColorDialog();
+
+ dlg.Color=Color.FromArgb(m_alphaSlider.Value,
+ m_redSlider.Value,
+ m_greenSlider.Value,
+ m_blueSlider.Value);
+
+ dlg.AnyColor=true;
+ dlg.SolidColorOnly=false;
+ dlg.FullOpen=true;
+
+ if (dlg.ShowDialog()==DialogResult.OK)
+ {
+ m_redSlider.Value=dlg.Color.R;
+ m_greenSlider.Value=dlg.Color.G;
+ m_blueSlider.Value=dlg.Color.B;
+ SetColour();
+ }
+ }
}
}
diff --git a/BitmapSpriteEd.AlphaColourDialog.resources b/BitmapSpriteEd.AlphaColourDialog.resources Binary files differnew file mode 100644 index 0000000..06a8784 --- /dev/null +++ b/BitmapSpriteEd.AlphaColourDialog.resources diff --git a/BitmapSpriteEd.prjx b/BitmapSpriteEd.prjx index 2f22c95..2322055 100644 --- a/BitmapSpriteEd.prjx +++ b/BitmapSpriteEd.prjx @@ -12,15 +12,16 @@ <File name=".\ManipulationMenu.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\DropShadowForm.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\BitmapFontEd.DropShadowForm.resources" subtype="Code" buildaction="EmbedAsResource" dependson="" data="" />
+ <File name=".\BitmapSpriteEd.AlphaColourDialog.resources" subtype="Code" buildaction="EmbedAsResource" dependson="" data="" />
</Contents>
<References />
<DeploymentInformation target="" script="" strategy="File" />
- <Configuration runwithwarnings="True" name="Debug">
- <CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="True" optimize="False" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="WinExe" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
+ <Configuration runwithwarnings="True" name="Release">
+ <CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="False" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" mainclass="" target="WinExe" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="False" />
- <Output directory=".\bin\Debug" assembly="BitmapSpriteEd" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
+ <Output directory=".\bin\Release" assembly="BitmapSpriteEd" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
- <Configurations active="Debug">
+ <Configurations active="Release">
<Configuration runwithwarnings="True" name="Debug">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="True" optimize="False" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="WinExe" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="False" />
|