日期:2014-05-18 浏览次数:20965 次
public bool CheckNoise(Bitmap bmp, int dgGrayValue)
{
bmp.Save("c:\\1.jpg"); // 保存到磁盘上以后, 并看不出有黑点
for (int x = 0; x < bmp.Width; x++)
{
for (int y = 0; y < bmp.Height; y++)
{
if (bmpobj.GetPixel(x, y).R < dgGrayValue)
{
bmp.Dispose();
bmp = null;
return true;
}
}
}
bmp.Dispose();
bmp = null;
return false;
}