rainxiang

莺莺燕燕翠翠红红处处融融洽洽 风风雨雨花花叶叶年年暮暮朝朝

 

缩略图品质

测试了下我所知道的所有方法,发现关键的地方还是
ImageCodecInfo myImageCodecInfo;
Encoder myEncoder;
EncoderParameter myEncoderParameter;
EncoderParameters myEncoderParameters;
myImageCodecInfo = GetEncoderInfo("image/jpeg");
myEncoder = Encoder.Quality;
myEncoderParameters = new EncoderParameters(1);
myEncoderParameter = new EncoderParameter(myEncoder, 95L);
myEncoderParameters.Param[0] = myEncoderParameter;

同时比较下不同设置的图片品质
1.只设置了graphics.SmoothingMode = SmoothingMode.HighQuality


2.只设置了graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic


3.同时设置了1,2两属性


4.只设置ImageCodecInfo myImageCodecInfo;
Encoder myEncoder;
EncoderParameter myEncoderParameter;
EncoderParameters myEncoderParameters;
myImageCodecInfo = GetEncoderInfo("image/jpeg");
myEncoder = Encoder.Quality;
myEncoderParameters = new EncoderParameters(1);
myEncoderParameter = new EncoderParameter(myEncoder, 95L);
myEncoderParameters.Param[0] = myEncoderParameter;


5.同时设置了1,2,4步



综上图示,图像的品质关键在于设置第四步...


另外对于myImageCodecInfo = GetEncoderInfo("image/jpeg");
我发现如果按原先的.gif图片来设置GetEncoderInfo("image/gif")的话,图片的象素将会丢失很严重,而设置为jpeg却很好,而关于象素的丢失如果原先的图片格式就为gif(256色)的话应该不会发生这么多象素丢失,如果原先图片是jpg(65536色)的话到是可能会有这么严重的丢失现象....怎么会这样呢..郁闷下....

posted on 2006-05-28 23:58  rainxiang  阅读(415)  评论(0编辑  收藏  举报

导航