Click here to Skip to main content
15,880,891 members
Articles / Programming Languages / C#

Image Processing for Dummies with C# and GDI+ Part 6 - The HSL color space

Rate me:
Please Sign up or sign in to vote.
4.84/5 (57 votes)
28 Jun 2004CPOL7 min read 418.9K   8K   199  
A discussion of the HSL color space, including code for a color picker and image filters
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace CSharpFilters
{
	/// <summary>
	/// Summary description for Password.
	/// </summary>
	public class Password : System.Windows.Forms.Form
	{
		public string ThePassword = "";

		private System.Windows.Forms.TextBox EnterPassword;
		private System.Windows.Forms.Button OK;
		private System.Windows.Forms.Button Cancel;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Password()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form 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.EnterPassword = new System.Windows.Forms.TextBox();
			this.OK = new System.Windows.Forms.Button();
			this.Cancel = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// EnterPassword
			// 
			this.EnterPassword.Location = new System.Drawing.Point(24, 16);
			this.EnterPassword.Name = "EnterPassword";
			this.EnterPassword.Size = new System.Drawing.Size(232, 20);
			this.EnterPassword.TabIndex = 0;
			this.EnterPassword.Text = "";
			// 
			// OK
			// 
			this.OK.Location = new System.Drawing.Point(48, 64);
			this.OK.Name = "OK";
			this.OK.TabIndex = 1;
			this.OK.Text = "OK";
			this.OK.DialogResult = DialogResult.OK;
			this.OK.Click += new System.EventHandler(this.OK_Click);
			// 
			// Cancel
			// 
			this.Cancel.Location = new System.Drawing.Point(144, 64);
			this.Cancel.Name = "Cancel";
			this.Cancel.TabIndex = 2;
			this.Cancel.Text = "Cancel";
			this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
			// 
			// Password
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(280, 94);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.Cancel,
																		  this.OK,
																		  this.EnterPassword});
			this.Name = "Password";
			this.Text = "Enter Password";
			this.ResumeLayout(false);

		}
		#endregion

		private void OK_Click(object sender, System.EventArgs e)
		{
			ThePassword = EnterPassword.Text;
		}

		private void Cancel_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

This article is part of the series 'Image Processing for Dummies with C# and GDI+ View All

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Australia Australia
Programming computers ( self taught ) since about 1984 when I bought my first Apple ][. Was working on a GUI library to interface Win32 to Python, and writing graphics filters in my spare time, and then building n-tiered apps using asp, atl and asp.net in my job at Dytech. After 4 years there, I've started working from home, at first for Code Project and now for a vet telemedicine company. I owned part of a company that sells client education software in the vet market, but we sold that and I worked for the owners for five years before leaving to get away from the travel, and spend more time with my family. I now work for a company here in Hobart, doing all sorts of Microsoft based stuff in C++ and C#, with a lot of T-SQL in the mix.

Comments and Discussions