Microsoft KB Archive/810112

= An EncoderParameter class constructor has 32-bit integers as the third and fourth parameters instead of enum integer constants in the .NET Framework 1.0 =

Article ID: 810112

Article Last Modified on 5/9/2007

-

APPLIES TO


 * Microsoft Common Language Runtime (included with the .NET Framework) 1.0

-





INTRODUCTION
This article discusses an EncoderParameter class constructor that has 32-bit integers as the third and fourth parameters. These constructor parameters are incorrect. The third and fourth parameters should be enum integer constants in the Microsoft .NET Framework 1.0.



MORE INFORMATION
The current definition of the EncoderParameter class constructor initializes a new instance of the EncoderParameter class that has the specified Encoder object, as in the following code: [C#] public EncoderParameter(  Encoder encoder,   int NumberOfValues,   int Type,   int Value ); The third and fourth parameters should be enum integer constants, as in the following code: [C#] public EncoderParameter( System.Drawing.Imaging.Encoder encoder,  int NumberOfValues,  System.Drawing.Imaging.EncoderParameterValueType Type,  System.Drawing.Imaging.EncoderValue Value ); To correctly call the EncoderParameter class constructor, cast the enum integer constants as int data types. For example, call the constructor with enum integer constants as the third and fourth parameters, as in the following code: EncoderParameter parameter = new EncoderParameter( Encoder.SaveFlag,  1,  (int)EncoderParameterValueType.ValueTypeLong,  (int)EncoderValue.MultiFrame );

