473,653 Members | 2,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp.net, with VB, Webcam

2 New Member
Hi to all,

I'm very new to asp.net and VB and I am currently working on a project that need to get a webcam to work in asp.net with VB and have been struggling for sometime.

I'll need to use the webcam to capture the image and this function to be used in a web form. This is the code that i'm currently working on.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Imports System
  3. Imports System.IO
  4. Imports System.Drawing
  5. Imports System.Drawing.Drawing2D
  6. Imports System.Drawing.Imaging
  7. Imports System.Net
  8.  
  9. Partial Class _Default
  10.     Inherits System.Web.UI.Page
  11.  
  12.  
  13.  
  14.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
  15.         'Jpeg compression quality 
  16.         Dim nQuality As Short = 45
  17.  
  18.         'Shout a picture from my webcam 
  19.         Dim cam As CAMSERVERLib.Camera = New CAMSERVERLib.CameraClass()
  20.  
  21.         Dim picture As Byte() = (cam.GrabFrame(nQuality))
  22.  
  23.         'Add the hour to the jpeg picture 
  24.         Dim ms As New MemoryStream(picture)
  25.         Dim bmp As New Bitmap(ms)
  26.  
  27.         Dim g As Graphics = Graphics.FromImage(bmp)
  28.  
  29.         Dim strDate As String = DateTime.Now.ToLongDateString() + " - " + DateTime.Now.ToLongTimeString()
  30.  
  31.         Dim drawFormat As New StringFormat()
  32.         drawFormat.Alignment = StringAlignment.Center
  33.  
  34.         g.DrawString(strDate, New Font(FontFamily.GenericSansSerif, 12), New SolidBrush(Color.Black), New RectangleF(1, 1, 320, 240), drawFormat)
  35.  
  36.         g.DrawString(strDate, New Font(FontFamily.GenericSansSerif, 12), New SolidBrush(Color.White), New RectangleF(0, 0, 320, 240), drawFormat)
  37.  
  38.         'Get codecs 
  39.         Dim icf As ImageCodecInfo() = ImageCodecInfo.GetImageEncoders()
  40.  
  41.         Dim encps As New EncoderParameters(1)
  42.         Dim encp As New EncoderParameter(System.Drawing.Imaging.Encoder.Quality, CLng(nQuality))
  43.  
  44.         'Set quality 
  45.         encps.Param(0) = encp
  46.  
  47.         bmp.Save(Response.OutputStream, icf(1), encps)
  48.  
  49.         g.Dispose()
  50.         bmp.Dispose()
  51.  
  52.     End Sub
  53. End Class
  54.  

What am i suppose to do now? Kinda stucked. Codes shows no errors?
Is it something to do with my web service? My driver? Or my design page?


Thx in advance.

Max
Jul 16 '08 #1
1 2720
chai0036
2 New Member
Btw, this is the webcam i'm using Microsoft LifeCam VX-1000. Hope it helps.

Max
Jul 16 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3935
by: Kelowna | last post by:
Yes... Its a server os... i kno! i hav xp yea but tis system is for screwing with.. Im sure theres alot of ppl here tat kno tis stuff inside-out! im doing this for educational purposes so dont give me that "Its intended for server" stuff... thanks! :-) Now that is out of the way lets get to it: I have Windows 2003 Server Enterprise and a Logitech Quickcam Web. I plugged it in and it loaded all the drivers automatically, yet I do not...
4
11980
by: Joakim Rylander | last post by:
Hi all, I need to create a public booth where people can look at themselves in a webcam and snap a picture which will be seen on a webpage. The backend is easy, it's the webcam part that I have problems with... Could you recommend the best way to capture a Webcam picture from .NET? Do I need device specific drivers or is there a standardized way to do it? Any recommended brand of Webcam?
0
2223
by: Elp | last post by:
Hi, We have developped an client application in C#. Among other things, this application should display in 4 different windows (or 4 different panels in the same window), 4 webcam streams (web streaming) from different webcams. We would like to set up a Webcam server on which we would connect several webcams (at least 12) and stream the output of each webcam on the web. That way, our client application could choose which webcam streams...
4
15173
by: Mathieu Chavoutier | last post by:
Hi. Is it possible to do a program that show the "film" that is currently on our webcam ? I do not have a Webcam for the moment, so, if you have advices to chose a Webcam compliant (with what I want to do), I would be thanksfull.
0
2047
by: Steve | last post by:
Hi Can anyone please tell me how to use a webcam on a form. I have done an app that uses a webcam, but I have used the drivers for that webcam. Now I need to use a different camera on a different site and obviously will have to reprogram for those drivers. Is there a generic webcam control that can be used I will only be using USB cameras
10
13778
by: aceto | last post by:
Hi. I'm sorry for my bad english, but it's not my motherlanguage. I need to read data from a webcam and display the images on DOS . So, how can i show this images? i have to translate the data received to a bitmap, to display it on the screen in DOS, mut i don't know how to do....can u give me some help or piece of advices? Thank you very much! Mark
3
2753
by: DillonCzerny | last post by:
Hello Many times I see a lot of people post webcam videos on google video or youtube. I wonder how do they record it from those people’s webcam? I have a fake webcam and I want to record some webcams so that I can play them on my fake webcam. Does any one know about any good webcam recorder software? Thank you for your help. Newbie
2
4138
by: =?Utf-8?B?d29vZHliZWFy?= | last post by:
I just bought a new Dell, so I'm sorry if this is a stupid question. There is a built-in webcam. Im using the disc provided by Dell (Dell Webcam Software), however during the installation, a pop-up window says to make sure the webcam USB cable is connected to the computer. What does this mean? The webcam is already build-in to the computer? This is preventing the installation of the software. Thank you for you help
1
2586
by: Fleets422 | last post by:
Hi, new kid on the block... Hope I am posting this in the proper forum as it involves HTML, JAVA as well as PHP. A little background... I have been writing PC apps using Borland's C++ Builder for many years and have written a couple WebCam utilities for my model airplane club. My utilities handle all the tasks of acquiring the images, FTPing them to the web site and handling via FTP image renaming replacing etc. What I don't know what I am...
13
7194
by: Berco Beute | last post by:
I've been trying to access my webcam using Python, but I failed miserably. The camera works fine under Ubuntu (using camora and skype), but I am unable to get WebCamSpy or libfg to access my webcam. First I tried webcamspy (http://webcamspy.sourceforge.net/). That requires pySerial and pyParallel, and optionally pyI2C. Runing WebCamSpy results in: Exception exceptions.AttributeError: "Parallel instance has no attribute '_fd'" in...
0
8370
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8470
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.