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 (810112)



The information in this article 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
);

REFERENCES

For more information about the EncoderParameter class, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:1/12/2005
Keywords:kbProgramming kbtshoot kbinfo KB810112 kbAudDeveloper