private System.Drawing.Bitmap ConvertImage(System.Drawing.Bitmap bx) { System.Drawing.Bitmap b = bx; switch (LoadOptions.Dither) { case LoadOptions.DitherFilter.FloydSteinbergDither: AddComment("Image Converted with FloydSteinbergDither"); AddComment("GrayThreshold", LoadOptions.GrayThreshold); b = new Framework.Tools.Drawing.FloydSteinbergDither { Graythreshold = LoadOptions.GrayThreshold }.Process(b); break; case LoadOptions.DitherFilter.NewspaperDither: AddComment("Image Converted with NewspaperDither"); AddComment("GrayThreshold", LoadOptions.GrayThreshold); AddComment("Dithersize", LoadOptions.NewspaperDitherSize); b = new Framework.Tools.Drawing.NewspapergDither { Graythreshold = LoadOptions.GrayThreshold, DotSize = LoadOptions.NewspaperDitherSize }.Process(b); break; } return(b); }
private System.Drawing.Bitmap ConvertImage(System.Drawing.Bitmap bx) { System.Drawing.Bitmap b = bx; switch (LoadOptions.Dither) { case LoadOptions.DitherFilter.FloydSteinbergDither: AddComment("Image Converted with FloydSteinbergDither"); AddComment("GrayThreshold", LoadOptions.GrayThreshold); b = new Framework.Tools.Drawing.FloydSteinbergDither() { Graythreshold = LoadOptions.GrayThreshold }.Process(b); break; case LoadOptions.DitherFilter.NewspaperDither: AddComment("Image Converted with NewspaperDither"); AddComment("GrayThreshold", LoadOptions.GrayThreshold); AddComment("Dithersize", LoadOptions.NewspaperDitherSize); b = new Framework.Tools.Drawing.NewspapergDither() { Graythreshold = LoadOptions.GrayThreshold, DotSize = LoadOptions.NewspaperDitherSize }.Process(b); break; } return b; }