Hi,
I have found an windows API for it which can we used for getting pixel count.
It is GetPixel Lib "gdi32" API below is sample code for it :-
Option Compare Database
Public Function GetPixlesTest(pHwnd As Long) As Integer: On Error Resume Next
Dim i As Long, j As Long, nBlack As Long, nWhite As Long, pHdc As Long, tempColor As Long
Dim count As Integer
count = 0
With Forms!frmTestSign!imgTest
pHdc1 = GetWindowDC(pHwnd)
For i = 0 To .Width
For j = 0 To .Heightenter code here
tempColor = GetPixel(pHdc1, i, j)
If tempColor = vbBlack Then
nBlack = nBlack + 1
End If
Next
Next
End With
TotalBlack = nBlack - 611
GetPixlesPractical = TotalBlack
End Function
Calling above function :-
gstrpixlecount = GetPixlesPractical(Me.hwnd)
Plesae follow below link for more info :-
http://msdn.microsoft.com/en-us/library/windows/desktop/dd144947(v=vs.85).aspx[
^]
http://msdn.microsoft.com/en-us/library/windows/desktop/dd144909(v=vs.85).aspx[
^]
http://www.vbdotnetforums.com/graphics-gdi/22565-using-winapi-getpixel.html[
^]
Thanks