473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Camera Capture

I have a nice little camera that I control via vb.net. It works fine
but it has a build in capture feature that is just too slow.

Dim snapBuffer(3533600)() As Byte 'raw video data
Dim FrameRGB24(10500000) As Byte 'rgb buffer
Dim DeviceH As Integer
Dim ResultOk As Object
Dim bm_gr As Graphics = eventSender.Picture1.CreateGraphics()
Dim bitM As Bitmap = New Bitmap(eventSender.Picture1.Width,
eventSender.Picture1.Height, Imaging.PixelFormat.Format24bppRgb)
Dim snapImage As Imaging.BitmapData
Dim rect1 As Rectangle = New Rectangle(0, 0,
eventSender.Picture1.Width, eventSender.Picture1.Height)
DeviceH = VbOpenDevice(DevNumber)

ResultOk=vbstartvideo(DeviceH)

For i = 0 To 23

ReDim snapBuffer(i)(3533600)

* * * ResultOk = VbGrabVideoFrame(DeviceH, snapBuffer(i), Params.Width
* Params.Height) * * *
(this is the line I would like to replace)
Next i
For i = 0 To 23

snapImage = bitM.LockBits(rect1, Imaging.ImageLockMode.WriteOnly,
Imaging.PixelFormat.Format24bppRgb)
VbBayerToRgb(snapBuffer(i), Params.Height, Params.Width, 1, FrameRGB24)
System.Runtime.InteropServices.Marshal.Copy(FrameR GB24, 0,
snapImage.Scan0, Params.Width * Params.Height * 3)

bitM.Save("SNAP" + CStr(i) + ".bmp", Imaging.ImageFormat.Bmp)

bitM.UnlockBits(snapImage)

Next i

Me.Picture1.BackColor = System.Drawing.SystemColors.Control
Me.Picture1.BorderStyle =
System.Windows.Forms.BorderStyle.Fixed3D
Me.Picture1.Cursor = System.Windows.Forms.Cursors.Default
Me.Picture1.Font = New System.Drawing.Font("Arial", 8.0!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
CType(0, Byte))
Me.Picture1.ForeColor = System.Drawing.SystemColors.ControlText
Me.Picture1.Location = New System.Drawing.Point(8, 16)
Me.Picture1.Name = "Picture1"
Me.Picture1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Picture1.Size = New System.Drawing.Size(400, 400)
Me.Picture1.TabIndex = 3
Me.Picture1.TabStop = False

Does anybody know how to grab video directly from the picture object?

Dec 14 '06 #1
0 974

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Newbie | last post by:
I am doing some robotics projects but my main area of interest is trying out several algorithms for the processing of the stream of data coming from the video. I am wondering what type of camera...
0
by: Ravi | last post by:
Hi, I've tried creating a capture graph twice for the same camera device in the same program. But, the second time I try to create graph for the device, Im getting an error at the "RenderStream"...
3
by: Saso Zagoranski | last post by:
Hi! Are the any classes I could use to get the picture from a USB camera? Thanks, Saso
3
by: john | last post by:
Hello, We have a vb.net application we are using for our field inspectors. We want to integrate a camera capturing tool into the application. Does anyone have any suggestions? The idea is that...
5
by: Brian | last post by:
Hello, I was wondering if anyone knows of an easy way to capture an image from a digital camera and put it into a picturebox. I need to be able to view the video feed and click a capture button...
9
by: aljosa | last post by:
i'm trying to capture video from camera/webcam using python. so far i haven't found any library that would allow me to do that. cross-platform solution related to SDL/pygame would be nice but a...
0
by: nrusinh | last post by:
I want to capture an image from digital camera using .NET, what API are available? how to do this? which camera is good?
0
by: kolgreen | last post by:
Hello! I have problem with capture a pictures from camera. When program is in tray or minimalized I can't take a picture. I think, problem is with handle, but I have not idea how change it. I...
4
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I'm looking for a good example to learn how can i capture a picture into my application using digital camera and C#. Thanks, Gidi.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.