Welcome to Dream.In.Code
Become a VB Expert!

Join 149,430 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,295 people online right now. Registration is fast and FREE... Join Now!




DRAWING OVER LIVE VIDEO

 
Reply to this topicStart new topic

DRAWING OVER LIVE VIDEO, I WANT TO DRAW USING THE MOUSE OVER LIVE VIDEO

JPIX
23 Jan, 2008 - 09:28 AM
Post #1

New D.I.C Head
*

Joined: 23 Jan, 2008
Posts: 1


My Contributions
'FOR WEBCAM DECLARATIONS

CODE

Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" Alias "capCreateCaptureWindowA" (ByVal lpszWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hwndParent As Long, ByVal nID As Long) As Long
Private mCapHwnd As Long
Private Const CONNECT As Long = 1034
Private Const DISCONNECT As Long = 1035
Private Const GET_FRAME As Long = 1084
Private Const COPY As Long = 1054
Dim x
Dim Y
Option Explicit
Private Sub picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)



If Button = 1 Then
Picture1.PSet (x, Y), vbRed
End If
End Sub



Private Sub Form_Load()
'set up the visual stuff
Picture1.Width = 640 * 15
Picture1.Height = 480 * 15


STARTCAM






End Sub
Private Sub Timer1_Timer()
'Get the picture from camera.. the main part
SendMessage mCapHwnd, GET_FRAME, 0, 0
SendMessage mCapHwnd, COPY, 0, 0
Picture1.Picture = Clipboard.GetData
Clipboard.Clear





End Sub

Sub STOPCAM()
DoEvents: SendMessage mCapHwnd, DISCONNECT, 0, 0
Timer1.Enabled = False
End Sub

Sub STARTCAM()
mCapHwnd = capCreateCaptureWindow("WebcamCapture", 0, 0, 0, 640, 480, Me.hwnd, 0)
DoEvents
SendMessage mCapHwnd, CONNECT, 0, 0
Timer1.Enabled = True
End Sub

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 11:33AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month