I've just discovered that these lines:
camwnd = Me.hWnd
CamHwnd = capCreateCaptur eWindow(camwnd, 0, 0, 0, 320, 240, Me.hWnd, 0)
are not needed in the timer sub, and actually cause lockups and problems, so I'm removing them from the code in my earlier post.
Edit: It seems I can't edit that older post. Anyway, it's line 45 and 46 in the first code I posted, in the Timer sub.
User Profile
Collapse
-
BTW, if anyone's interested, this is the sub I use to get Red, Green and Blue from the color value:
[CODE=vb]
Public Function get_rgb(Color, rd, gr, bl)
Dim tmpColor
If Color < 0 Then Color = 0
tmpColor = Color / 65536
bl = Int(tmpColor)
tmpColor = (tmpColor - Int(tmpColor)) * 256
gr = Int(tmpColor)
tmpColor = (tmpColor -...Leave a comment:
-
Well, I just made the strangest breakthrough.
I removed the saving and loading of the image file, and replaced "Picture1.h wnd" with "Me.HWnd" in the capCreateCaptur eWindow command at line 9 in my code, and... it works!!!
I have no idea why or how, but it works. The image is now drawn directly on the form's surface, and I can still use Me.Picture1.Poi nt to get the value, which can then be split up...Leave a comment:
-
Hi, I'm having the exact same problem. I am trying to detect certain pixels from a video streaming from a webcam (don't really need to detect the entire webcam image, just 10 or 20 pixels of it to see if they change).
But I can't get it working! I've followed this thread and this is the code I've ended up with:
This is the code in a module (.bas file):
Code:Option Explicit Public Const
Last edited by Killer42; Mar 3 '08, 01:26 AM. Reason: Italicised lines 45-46 which have since been found to be in error.Leave a comment:
No activity results to display
Show More
Leave a comment: