To do some sanity checks, I used the CountColor function to do some of my own math. According to that math, the image is 99.50097 percent white. So if I set the Confidence to 99.6, isBlank should return "False" correct? Or am I misunderstanding the use of that parameter?
My simple test script code is below and the image I am testing is attached. Using ASP.net 4.0 and GdPicture 8.5.0.8.
Code: Select all
Dim oGdPictureImaging As New GdPictureImaging
Dim oLicenseManager As New LicenseManager
oLicenseManager.RegisterKEY("XXXX")
' Process command line input(s)
Dim imageFile As String = My.Application.CommandLineArgs(0).Trim()
Dim isBlankPercent As Single = Single.Parse(My.Application.CommandLineArgs(1).Trim())
' Open the image
Console.WriteLine("Opening Image...")
Dim image_ID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile(imageFile)
Console.WriteLine("Image Opened as ID: " & image_ID.ToString())
' Count the number of pixels in the whole image
Dim pixelCount As Integer = oGdPictureImaging.GetHeight(image_ID) * oGdPictureImaging.GetWidth(image_ID)
Console.WriteLine("Total Number of Pixels: " & pixelCount.ToString())
' Total Number of white pixels
Dim whiteCount As Integer = oGdPictureImaging.CountColor(image_ID, oGdPictureImaging.ARGB(255, 255, 255))
Console.WriteLine("White Pixel Count: " & whiteCount.ToString())
Console.WriteLine("Percent White Pixels: " & ((whiteCount / pixelCount) * 100).ToString())
If oGdPictureImaging.IsBlank(image_ID, isBlankPercent) Then
Console.WriteLine("Image is Blank.")
Else
Console.WriteLine("Image is Non-blank.")
End If
Console.WriteLine("Done.")