rawsonl#1857
I was using the following code:
to determine white space but it thinks every image has all white pixels. What would the proper code to do this look like? The example provided here in VB ->
http://www.aurigma.com/docs/gm/AccessingtoPixelData.htm
gets an error on Marshal. What is Marshal???
Thanks,
Linda
Public Function isWhiteImage(ByVal theImage As System.Drawing.Bitmap) As Boolean
Dim bitmap As New Aurigma.GraphicsMill.Bitmap(theImage)
Dim data As BitmapData = bitmap.LockBits()
'Number of rows
Dim height As Integer = data.Height
'Number of columns
Dim width As Integer = data.Width
Dim countOfWhitePixels As Integer = 0
Dim i, j As Integer
For i = 0 To height - 1
For j = 0 To width - 1
'Read a single pixel
Dim color As Aurigma.GraphicsMill.Color = data.GetPixel(i, j)
If (color.GetChannel32(ColorChannel.Red) = color.GetChannel32(ColorChannel.Green)) Then
If (color.GetChannel32(ColorChannel.Red) = color.GetChannel32(ColorChannel.Blue)) Then
countOfWhitePixels = countOfWhitePixels + 1
If countOfWhitePixels > (data.Height / 2) Then
i = height - 1
j = width - 1
End If
End If
End If
Next j
Next i
bitmap.UnlockBits(data)
If (countOfWhitePixels >= data.Height / 2) Then
Return True
Else
Return False
End If
End Functionto determine white space but it thinks every image has all white pixels. What would the proper code to do this look like? The example provided here in VB ->
http://www.aurigma.com/docs/gm/AccessingtoPixelData.htm
gets an error on Marshal. What is Marshal???
Thanks,
Linda