Beispiel #1
0
		private void PreviewHue( int x, int y )
		{
			Hue hue = m_Hues[ this.GetHueIndex( x, y ) ];

			if ( hue != m_Hue )
			{
				m_Hue = hue;

				labName.Text = hue.Name;

				imgHue.Image = hue.GetSpectrum( imgHue.Size );

				this.GCSteps++;

				if ( GCSteps == 10 )
				{
					GCSteps = 0;
					GC.Collect();
				}
			}
		}
Beispiel #2
0
		/// <summary>
		/// Reads a Hue
		/// </summary>
		/// <param name="reader">The data reader</param>
		/// <returns>The hue read</returns>
		public static Hue Read( BinaryReader reader )
		{
			Hue hue = new Hue();

			hue.m_ColorTable = new short[ 32 ];
			hue.m_Name = new char[ 20 ];

			for ( int i = 0; i < 32; i++ )
				hue.m_ColorTable[ i ] = reader.ReadInt16();

			hue.m_TableStart = reader.ReadInt16();
			hue.m_TableEnd = reader.ReadInt16();
			
			hue.m_Name = reader.ReadChars( 20 );

			return hue;
		}