Bloom.Edit.JpegWarningDialog.HasLotsOfWhiteSpace C# (CSharp) Method

HasLotsOfWhiteSpace() private static method

private static HasLotsOfWhiteSpace ( Bitmap bmp ) : bool
bmp System.Drawing.Bitmap
return bool
        private static bool HasLotsOfWhiteSpace(Bitmap bmp)
        {
            const double threshold = .5; // we'll warn if any of the samples we take of the image show > 50% white
            var sampleLinePercentages = new[] { 20, 50, 70 };
            return
                sampleLinePercentages.Any(sampleLine => GetPercentWhiteOfLine(bmp, (int)(bmp.Height * (sampleLine / 100.0))) > threshold);
        }