日期:2011-06-20 浏览次数:20441 次
public class Bmp2Jpeg
{
private long lQuality=50L;
private ImageCodecInfo myImageCodecInfo;
private EncoderParameters myEncoderParameters;
public Bmp2Jpeg(long Quality)
{
lQuality=Quality;
Ini();
}
private void Ini()
{
System.Drawing.Imaging.Encoder myEncoder;
EncoderParameter myEncoderParameter;
myImageCodecInfo = GetEncoderInfo("image/jpeg");
myEncoder = System.Drawing.Imaging.Encoder.Quality;
myEncoderParameters = new EncoderParameters(1);
myEncoderParameter = new EncoderParameter(myEncoder,lQuality);
myEncoderParameters.Param[0] = myEncoderParameter;