public static Bitmap ConvertTo1Bit( [NotNull] Bitmap sourceBitmap, MonochromeConversionMode mode = MonochromeConversionMode.FloydSteinbergDithering, int threshold = 127 ) { if (sourceBitmap == null) throw new ArgumentNullException("sourceBitmap"); switch (mode) { case MonochromeConversionMode.ThresholdBased: return ThresholdBasedMonochrome(sourceBitmap, threshold); case MonochromeConversionMode.FloydSteinbergDithering: return FloydSteinbergDithering(sourceBitmap); default: throw new ArgumentOutOfRangeException("mode", mode, null); } }
public static Bitmap ConvertTo1Bit ( [NotNull] Bitmap sourceBitmap, MonochromeConversionMode mode = MonochromeConversionMode.FloydSteinbergDithering, int threshold = 127 ) { if (sourceBitmap == null) { throw new ArgumentNullException("sourceBitmap"); } switch (mode) { case MonochromeConversionMode.ThresholdBased: return(ThresholdBasedMonochrome(sourceBitmap, threshold)); case MonochromeConversionMode.FloydSteinbergDithering: return(FloydSteinbergDithering(sourceBitmap)); default: throw new ArgumentOutOfRangeException("mode", mode, null); } }