VB.Net Photo Booth项目

时间:2015-03-12 00:49:18

标签: vb.net webcam mouseclick-event

所以我姐姐的高中毕业即将到来。她真的很喜欢看她朋友的照片所以我有这个想法制作照片展台风格的节目。此时,我将网络摄像头显示在图片框上,但是单击和鼠标滑动子程序不起作用。有谁知道为什么会这样?

    Private Sub picCapture_MouseClick(sender As Object, e As MouseEventArgs) Handles picCapture.MouseClick
        MsgBox("hi")
End Sub

    Dim iHeight As Integer = picCapture.Height
        Dim iWidth As Integer = picCapture.Width

        hHwnd = capCreateCaptureWindowA(DeviceID.ToString, WS_VISIBLE Or WS_CHILD, 0, 0, 1280, _
            1024, picCapture.Handle.ToInt32, 0)

        If SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, DeviceID, 0) Then

            SendMessage(hHwnd, WM_CAP_SET_SCALE, True, 0)

            SendMessage(hHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0)

            'Start previewing the image from the camera

            SendMessage(hHwnd, WM_CAP_SET_PREVIEW, True, 0)

            SetWindowPos(hHwnd, HWND_BOTTOM, 0, 0, picCapture.Width, picCapture.Height, _
                    SWP_NOMOVE Or SWP_NOZORDER)

        Else
            ' Error connecting to device close window
            DestroyWindow(hHwnd)
        End If

感谢任何帮助。 :)

0 个答案:

没有答案