/// <summary>
/// 将bitmap转化为1位黑白像素图像(仅保留黑色,其它颜色会删除)
/// </summary>
/// <param name="bmp"></param>
/// <returns></returns>
public static Bitmap To1Bit(Bitmap bmp)
{
Bitmap tmp = bmp.Clone(new Rectangle(0, 0, bmp.Width, bmp.Height), PixelFormat.Format1bppIndexed);
return tmp;
}
将bitmap转化为1位黑白像素图像(仅保留黑色,其它颜色会删除)
于 2023-11-22 10:59:05 首次发布