如何把GET到的图片变清晰
cstgw 2011-03-04 01:45:55 如何把GET到的图片变清晰,获得的图片质量总是不清晰,有什么办法 ?
public void DownImage()
{
WebClient client = new WebClient();
foreach (KeyValuePair<string, string> KeyValue in replace)
{
FileInfo info = new FileInfo(KeyValue.Value);
if (!info.Directory.Exists)
info.Directory.Create();
try
{
client.DownloadFile(KeyValue.Key, KeyValue.Value);
System.Drawing.Image image = System.Drawing.Image.FromFile(KeyValue.Value);
int width =image.Width;
image.Dispose();
if (width>700)ImageFunction.Compress(KeyValue.Value, 700, 0, true);
if (width > 200) ImageFunction.WaterMark(KeyValue.Value, MarkPath);
}
catch(Exception ex)
{
Log("ImageError:" + ex.Message);
}
}
}