|
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "www.codeproject.com")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebCamService : System.Web.Services.WebService
{
private WebCamLibrary.WebCam cam;
public WebCamService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
//Please Choose one of these two ways to grab frames. You cannot use both at the same time.
//use WebCamLibrary.WebCam.NewWebCamDirectX(); if your camera doesnt work with WIA.
cam = WebCamLibrary.WebCam.NewWebCamWIA();
// cam = WebCamLibrary.WebCam.NewWebCamDirectX();
cam.Initialize();
}
[WebMethod]
public byte[] GrabFrame() {
return cam.GrabFrame();
}
[WebMethod]
public string[] GetConnectedCameras()
{
return cam.GetDevices();
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.