Watch this space.
Printable View
ok ill watch for it... you're fast to reply huh...
Email Notifications FTW :)
I'm working on a C# Class for this now, since my skill base has swifted away from VB. However the DLL release will be find for using with VB
wow that will be great... now i see you shifted to c#:bigyello:
Hi everyone.. finally i founded someone that is working on my problem..
unfortunely i'm not a good developer and i'm trying to solve my big trouble..
I need to create something "fun" for the kids in an hospitality centre.. they need to register themself (i created a small VB6 application with Ms Access) but we need also a picture of them. I can create a button that call an external exe (created with modern system ...) and this program create a fun picture (with png background, like Happy Birthday, Baloons..etc etc)
For this reason i'm trying to help this friend of mine with the creation of this simple software..
if anyone can help me, i will be appreciate very much.. it's for a good thing.
I downloaded the EDID software.. and i'm able to see webcam in the form, but i cannot customize the effects..
i attached here with the post the picture of my "desire"..
thank you very much everybody!
nobody can help me with any advices?
:(
I'd post that question in the MainForum since its not really to do with the webcam feed.
As for the re-write I'm working on, I'm likly going to drop it. The recording of video is effectivly useless without compression (1 sec = 1Meg). The support for adjusting FPS is not very good.
Suppose I could re-write it using DirectShow but documentation is limited to C++ :(
hi pino i have used your code the WebCamVewer and i have a problem... it starts me camera but all i see is black, even the snapshots are black! i dont know what to do, pls help..:(
i dont remember the model of the camera, but is a built-on Webcam on my hp pavilion dv9000 labtop...
if i understand well you are asking me if another application is using the camera the same time... there is no other app that uses the webcam that time
Have you ever used your webcam with any other application?
yes i have with skype and msn
Exactly same problem as tripes...and yup, I've used my webcam before, in fact, I use it daily.
Hope you can help!
pino i forgot to tell you that i used my cam with the app "Cyberlink YouCam" as with msn and skype...
i have the same problem!!! please help if you can :(
I found the code very very usefull. However I have almost the same problem as the other guys, my ViewFinder is black, BUT the capture works fine. I'm using the built in camera of an HP pavilion dv2000 (Manufacturer: Microsoft)
Any idea??
Here is the icam class used in a motion detector.
I was too lazy to rename some of the labels and such but its not that bad i promise.
all the main guts of the program are commented and named.
I just left the unimportant stuff default.
Attachment 71112
Invalid Link
I want to make a note regarding "motion detection".
Comparing 2 images pixel by pixel will not guarantee to detect a motion. Also changing light etc will cause a detection. Its better to divide the image in several areas. In each area the avarage is taken. Then the ratios between the areas can be used as detection. Averaging of several areas can be time consuming. However certain algoritms like "integral image" can be used and are fast.
namrekka
thank you for the input. I didn't think to go about it in such a way but the more i think about it the more that makes sense. I've already started working on it. Thanks :)
Hey Pino that`s a great code!
I was wondering if you could help me a little bit with your class!
I don`t understand the following:
1) these are used inside the copyFrame function what are they exactly?
Dim HDC1 As IntPtr = srcPic.GetHdc
Dim HDC2 As IntPtr = srcMem.GetHdc
BitBlt(HDC2, 0, 0, CInt(rect.Width), _
CInt(rect.Height), HDC1, CInt(rect.X), CInt(rect.Y), 13369376)
copyFrame = CType(srcBmp.Clone(), Bitmap)
srcPic.ReleaseHdc(HDC1)
srcMem.ReleaseHdc(HDC2)
srcPic.Dispose()
srcMem.Dispose()
2) and this bitmapdirect class what does it do exactly?
Public Class BitmapDirect
i`m trying to implement your code for a motion detection one!
Thanks in advance!
Hi
Do everyone know a possible way to catch de button press event form the button of my webcam? My app should recognize when someone presses the button of my webcam.
I'm happy about every information that solves my problem :)
This is a great thread.
I would like to know, do I need one class for each web cam. for example i want to put this on a passworded website, but i need the ability for 6 web cams. Is this possible with the code on here ?
Thanks.
Addy
I have been experimenting with this and find there is a significant problem. The technique used to capture frames from the camera video is actually capturing the current displayed screen image. As such, it captures whatever is displayed on the screen, which includes any other windows that might be on top of the one with the camera image.
It seemed like a great idea until I started working on motion detection and started seeing unexpected motion when other windows were active.
It would seem that the only reliable way to capture an image from the camera might be sending the WM_CAP_EDIT_COPY message after all...
William
Hello everyone.
I have downloaded & compiled ICam and have it working on my local machine. Now I am needing to be able to broadcast the video to a website. Can anyone help me in accomplishing this. Also, will this handle audio also?
Motion Detection:
I wrote some motion detection code to catch the dog dumping in my front garden :)
Attached is the source project for this.
Run it. Click button 1 to start camera.
The slider adjusts the sensitivity of the motion detection.
The SecurityCam::GetMotion method is responsible for detecting motion.
This can be coded to look for specific colors.
ie. I set it up so it only detected white moving objects, as I knew the dog was whitish and not blue :)
Hope this helps.
#
Woka
Wokawidget your last source works fine... everything, starts the cam and everything, but don't show any image..
Anyone?
Any errors?
Works fine on my test pcs.
Have you got the shutter/cover open on your web cam?
Woka
thx for the code Pino.....it was a great help for me
btw... I have one problem here.... which is why after I have complied the code...
the webcam image that I have capture is not at the center meaning I was in front of the webcam already.. and the webcam image should have shown an image of myself in the center rite, but the result is the image of myself is on the right hand side only.........
jack, could you get image from the webcam?
Thank you!!
This usefulness works perfectly.
But I have a doubt: Since it is possible to conceal the floating picture that goes out " origin of video "?? I need to conceal it. Thank you
i need help..
this progrma hung up line "SendMessage(hWnd, WM_CAP_DRIVER_DISCONNECT, CamSource, 0)"
this my coding,,,
vb.net Code:
Imports System Imports System.IO Imports System.Runtime.InteropServices Imports Microsoft.Win32 Public Class Form1 Inherits System.Windows.Forms.Form Const WM_CAP_START = &H400S Const WS_CHILD = &H40000000 Const WS_VISIBLE = &H10000000 Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10 Const WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 12 Const WM_CAP_EDIT_COPY = WM_CAP_START + 30 Const WM_CAP_SEQUENCE = WM_CAP_START + 62 Const WM_CAP_FILE_SAVEAS = WM_CAP_START + 23 Const WM_CAP_SET_SCALE = WM_CAP_START + 53 Const WM_CAP_SET_PREVIEWRATE = WM_CAP_START + 52 Const WM_CAP_SET_PREVIEW = WM_CAP_START + 50 Const SWP_NOMOVE = &H2S Const SWP_NOSIZE = 1 Const SWP_NOZORDER = &H4S Const HWND_BOTTOM = 1 '--The capGetDriverDescription function retrieves the version ' description of the capture driver-- Declare Function capGetDriverDescriptionA Lib "avicap32.dll" _ (ByVal wDriverIndex As Short, _ ByVal lpszName As String, ByVal cbName As Integer, _ ByVal lpszVer As String, _ ByVal cbVer As Integer) As Boolean '--The capCreateCaptureWindow function creates a capture window-- Declare Function capCreateCaptureWindowA Lib "avicap32.dll" _ (ByVal lpszWindowName As String, ByVal dwStyle As Integer, _ ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, _ ByVal nHeight As Short, ByVal hWnd As Integer, _ ByVal nID As Integer) As Integer '--This function sends the specified message to a window or windows-- Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As Integer, ByVal Msg As Integer, _ ByVal wParam As Integer, _ <MarshalAs(UnmanagedType.AsAny)> ByVal lParam As Object) As Integer '--Sets the position of the window relative to the screen buffer-- Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" _ (ByVal hwnd As Integer, _ ByVal hWndInsertAfter As Integer, ByVal x As Integer, _ ByVal y As Integer, _ ByVal cx As Integer, ByVal cy As Integer, _ ByVal wFlags As Integer) As Integer '--This function destroys the specified window-- Declare Function DestroyWindow Lib "user32" _ (ByVal hndw As Integer) As Boolean '---used to identify the video source--- Dim CamSource As Long '---used as a window handle--- Dim hWnd As Integer Private Sub cameraSource() Dim DriverName As String = Space(80) Dim DriverVersion As String = Space(80) For i As Integer = 0 To 9 If capGetDriverDescriptionA(i, DriverName, 80, _ DriverVersion, 80) Then ListBox1.Items.Add(DriverName.Trim) End If Next End Sub Private Sub previewCamera(ByVal pbCtrl As PictureBox) hWnd = capCreateCaptureWindowA(CamSource, _ WS_VISIBLE Or WS_CHILD, 0, 0, 0, _ 0, pbCtrl.Handle.ToInt32, 0) If SendMessage( _ hWnd, WM_CAP_DRIVER_CONNECT, _ CamSource, 0) Then '---set the preview scale--- SendMessage(hWnd, WM_CAP_SET_SCALE, True, 0) '---set the preview rate (ms)--- SendMessage(hWnd, WM_CAP_SET_PREVIEWRATE, 30, 0) '---start previewing the image--- SendMessage(hWnd, WM_CAP_SET_PREVIEW, True, 0) '---resize window to fit in PictureBox control--- SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, _ pbCtrl.Width, pbCtrl.Height, _ SWP_NOMOVE Or SWP_NOZORDER) Else '--error connecting to video source--- DestroyWindow(hWnd) End If End Sub Private Sub stopPreviewCamera() SendMessage(hWnd, WM_CAP_DRIVER_DISCONNECT, CamSource, 0) DestroyWindow(hWnd) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cameraSource() Button4.Enabled = False Button1.Enabled = False Button2.Enabled = False Button3.Enabled = False End Sub Private Sub ListBox1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick Label1.Visible = False previewCamera(PictureBox1) Button1.Enabled = True Button4.Enabled = False Button2.Enabled = True End Sub Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged CamSource = ListBox1.SelectedIndex '---preview the selected video source End Sub 'stop preview Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click stopPreviewCamera() Button4.Enabled = True Button1.Enabled = False End Sub ' recording Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Button3.Enabled = True Button2.Enabled = False SendMessage(hWnd, WM_CAP_SEQUENCE, 0, 0) End Sub ' stop recording and ask to save video Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click SendMessage(hWnd, WM_CAP_FILE_SAVEAS, 0, "C:\RecordedVideo.avi") Button2.Enabled = True Button3.Enabled = False End Sub ' preview Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click CamSource = ListBox1.SelectedIndex previewCamera(PictureBox1) Button4.Enabled = False Button1.Enabled = True End Sub End Class
i need solution please help me,,