<PackageReference Include="System.Drawing.Common" Version="9.0.0-rc.2.24474.1" />

EncoderParameter

public sealed class EncoderParameter : IDisposable
Used to pass a value, or an array of values, to an image encoder.
public Encoder Encoder { get; set; }

Gets or sets the Encoder object associated with this EncoderParameter object. The Encoder object encapsulates the globally unique identifier (GUID) that specifies the category (for example Quality, ColorDepth, or Compression) of the parameter stored in this EncoderParameter object.

public int NumberOfValues { get; }

Gets the number of elements in the array of values stored in this EncoderParameter object.

Gets the data type of the values stored in this EncoderParameter object.

Gets the data type of the values stored in this EncoderParameter object.

public EncoderParameter(Encoder encoder, byte value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and one unsigned 8-bit integer. Sets the ValueType property to ValueTypeByte, and sets the NumberOfValues property to 1.

public EncoderParameter(Encoder encoder, byte value, bool undefined)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and one 8-bit value. Sets the ValueType property to ValueTypeUndefined or ValueTypeByte, and sets the NumberOfValues property to 1.

public EncoderParameter(Encoder encoder, byte[] value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and an array of unsigned 8-bit integers. Sets the ValueType property to ValueTypeByte, and sets the NumberOfValues property to the number of elements in the array.

public EncoderParameter(Encoder encoder, byte[] value, bool undefined)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and an array of bytes. Sets the ValueType property to ValueTypeUndefined or ValueTypeByte, and sets the NumberOfValues property to the number of elements in the array.

public EncoderParameter(Encoder encoder, short value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and one, 16-bit integer. Sets the ValueType property to ValueTypeShort, and sets the NumberOfValues property to 1.

public EncoderParameter(Encoder encoder, short[] value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and an array of 16-bit integers. Sets the ValueType property to ValueTypeShort, and sets the NumberOfValues property to the number of elements in the array.

public EncoderParameter(Encoder encoder, int numberValues, EncoderParameterValueType type, IntPtr value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object, number of values, data type of the values, and a pointer to the values stored in the EncoderParameter object.

public EncoderParameter(Encoder encoder, int numerator, int denominator)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and a pair of 32-bit integers. The pair of integers represents a fraction, the first integer being the numerator, and the second integer being the denominator. Sets the ValueType property to ValueTypeRational, and sets the NumberOfValues property to 1.

public EncoderParameter(Encoder encoder, int NumberOfValues, int Type, int Value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and three integers that specify the number of values, the data type of the values, and a pointer to the values stored in the EncoderParameter object.

public EncoderParameter(Encoder encoder, int numerator1, int demoninator1, int numerator2, int demoninator2)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and four, 32-bit integers. The four integers represent a range of fractions. The first two integers represent the smallest fraction in the range, and the remaining two integers represent the largest fraction in the range. Sets the ValueType property to ValueTypeRationalRange, and sets the NumberOfValues property to 1.

public EncoderParameter(Encoder encoder, int[] numerator, int[] denominator)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and two arrays of 32-bit integers. The two arrays represent an array of fractions. Sets the ValueType property to ValueTypeRational, and sets the NumberOfValues property to the number of elements in the numerator array, which must be the same as the number of elements in the denominator array.

public EncoderParameter(Encoder encoder, int[] numerator1, int[] denominator1, int[] numerator2, int[] denominator2)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and four arrays of 32-bit integers. The four arrays represent an array rational ranges. A rational range is the set of all fractions from a minimum fractional value through a maximum fractional value. Sets the ValueType property to ValueTypeRationalRange, and sets the NumberOfValues property to the number of elements in the numerator1 array, which must be the same as the number of elements in the other three arrays.

public EncoderParameter(Encoder encoder, long value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and one 64-bit integer. Sets the ValueType property to ValueTypeLong (32 bits), and sets the NumberOfValues property to 1.

public EncoderParameter(Encoder encoder, long rangebegin, long rangeend)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and a pair of 64-bit integers. The pair of integers represents a range of integers, the first integer being the smallest number in the range, and the second integer being the largest number in the range. Sets the ValueType property to ValueTypeLongRange, and sets the NumberOfValues property to 1.

public EncoderParameter(Encoder encoder, long[] value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and an array of 64-bit integers. Sets the ValueType property to ValueTypeLong (32-bit), and sets the NumberOfValues property to the number of elements in the array.

public EncoderParameter(Encoder encoder, long[] rangebegin, long[] rangeend)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and two arrays of 64-bit integers. The two arrays represent an array integer ranges. Sets the ValueType property to ValueTypeLongRange, and sets the NumberOfValues property to the number of elements in the rangebegin array, which must be the same as the number of elements in the rangeend array.

public EncoderParameter(Encoder encoder, string value)

Initializes a new instance of the EncoderParameter class with the specified Encoder object and a character string. The string is converted to a null-terminated ASCII string before it is stored in the EncoderParameter object. Sets the ValueType property to ValueTypeAscii, and sets the NumberOfValues property to the length of the ASCII string including the NULL terminator.

public void Dispose()

Releases all resources used by this EncoderParameter object.