0
我不知道我做錯了,我一直在尋找網絡,並嘗試了很多不同的東西,但沒有任何作品,當我嘗試保存圖像有很多灰點C#圖像保存點
結果可以在這裏看到
http://postimg.org/image/btvob8f6l/
public static void ExifSave(List<InfoList> data)
{
ImageCodecInfo jgpEncoder = GetEncoder(ImageFormat.Jpeg);
System.Drawing.Imaging.Encoder myEncoder = System.Drawing.Imaging.Encoder.Quality;
EncoderParameters myEncoderParameters = new EncoderParameters(1);
EncoderParameter myEncoderParameter = new EncoderParameter(myEncoder, 50L);
myEncoderParameter = new EncoderParameter(myEncoder, 100L);
myEncoderParameters.Param[0] = myEncoderParameter;
list = data;
foreach (InfoList i in data)
{
SetProperty(ref prop, i.id, i.value);
image.SetPropertyItem(prop);
}
fs.Dispose();
try
{
image.Save(Path);
}
catch (Exception e)
{
new MessagePromt("DEBUG::LoadImages()::Error attempting to create image::" + e.Message, e.Message);
}
}
private static ImageCodecInfo GetEncoder(ImageFormat format)
{
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders();
foreach (ImageCodecInfo codec in codecs)
{
if (codec.FormatID == format.Guid)
{
return codec;
}
}
return null;
}
用小得多的圖像進行測試,看看數據包含了什麼。 – SimpleVar
圖像對象的類型是什麼? –
system.drawing.bitmap – Narzul