TagLib.IFD.IFDStructure.SetRationalValue C# (CSharp) Method

SetRationalValue() public method

Adds a Entries.RationalIFDEntry to the directory with tag given by entry_tag and value given by value
public SetRationalValue ( int directory, ushort entry_tag, double value ) : void
directory int /// A with the number of the directory /// to add the entry to. ///
entry_tag ushort /// A with the tag of the entry ///
value double /// A with the value to add. It must be possible to /// represent the value by a . ///
return void
		public void SetRationalValue (int directory, ushort entry_tag, double value)
		{
			if (value < 0.0d || value > (double)UInt32.MaxValue)
				throw new ArgumentException ("value");
			
			uint scale = (value >= 1.0d) ? 1 : UInt32.MaxValue;
			
			Rational rational = new Rational ((uint) (scale * value), scale);
			
			SetEntry (directory, new RationalIFDEntry (entry_tag, rational));
		}