示例#1
0
		// ====================================================================
		// Description:	Color - split channels
		// Return		void
		void Color_Split_RGB ( object sender, EventArgs ev )
		// ====================================================================
		{
			try
			{
				if ( m_list.Count > 0 )
				{
					ImageView img = (ImageView)this.ActiveMdiChild;
					ColorRGB clr = new ColorRGB(img);
					
					string[] sName = new string[3];
					sName[(int)ClrChannel.Blue] = "_Blue";
					sName[(int)ClrChannel.Green] = "_Green";
					sName[(int)ClrChannel.Red] = "_Red";

					this.Cursor = Cursors.WaitCursor;
					
					for ( int i = 0; i < 3; i ++ )
					{
						Bitmap bmp = clr.GetChannel ( i );
						ImageView fm = new ImageView();
						fm.MdiParent = this;
						fm.OnInitForm ( img.Text + sName[i], bmp );
						fm.OnFormSize ( img.Width - img.XPADD, img.Height - img.YPADD );
						fm.Show();
						m_list.Add (fm);
					}

					this.Cursor = Cursors.Default;
				}
			}
			catch(Exception e)
			{
				DisplayError("Color_Split_RGB() failed " + e.ToString() );
			}
		}
示例#2
0
		// ====================================================================
		// Description:	Color to gray
		// Return		void
		void Color_2_Gray ( object sender, EventArgs ev )
		// ====================================================================
		{
			try
			{
				if ( m_list.Count > 0 )
				{
					ImageView img = (ImageView)this.ActiveMdiChild;
					ColorRGB clr = new ColorRGB(img);
					
					string sName = "_Gray";

					this.Cursor = Cursors.WaitCursor;			
					
					Bitmap bmp = clr.GetChannel ( (int)ClrChannel.Gray );
					ImageView fm = new ImageView();
					fm.MdiParent = this;
					fm.OnInitForm ( img.Text + sName, bmp );
					fm.OnFormSize ( img.Width - img.XPADD, img.Height - img.YPADD );
					fm.Show();
					m_list.Add (fm);

					this.Cursor = Cursors.Default;
				}
			}
			catch(Exception e)
			{
				DisplayError("Color_2_Gray() failed " + e.ToString() );
			}
		}