If all pixels same color then return

This commit is contained in:
Jaex 2017-11-29 00:32:02 +03:00
parent 004b74b198
commit ec9f9e6bf2

View file

@ -1671,6 +1671,12 @@ public static Rectangle FindAutoCropRectangle(Bitmap bmp, bool sameColorCrop = f
}
}
// If all pixels same color
if (!leave)
{
return crop;
}
leave = false;
if (!sameColorCrop)
@ -1739,7 +1745,7 @@ public static Rectangle FindAutoCropRectangle(Bitmap bmp, bool sameColorCrop = f
}
/// <summary>
/// If auto crop rectangle and source image rectangle is same then null will be returned.
/// If crop rectangle and source image rectangle is same then null will be returned.
/// After auto crop, source image will be disposed.
/// </summary>
public static Bitmap AutoCropImage(Bitmap bmp, bool sameColorCrop = false)