2009-11-03 6 views

Répondre

4

Simpliest et la plus simple serait probablement utiliser SDK Microsoft Expression Encoder:

static void Main(string[] args) 
{ 
    var job = new Microsoft.Expression.Encoder.Live.LiveJob(); 
    job.AddDeviceSource(job.VideoDevices[0],job.AudioDevices[0]); 
    var w = new System.Windows.Forms.Form(); 
    w.Show(); 
    var source = job.DeviceSources[0]; 
    source.PreviewWindow = new Microsoft.Expression.Encoder.Live.PreviewWindow(new System.Runtime.InteropServices.HandleRef(w, w.Handle)); 
    Console.ReadKey(); 
} 
-1

Jetez un oeil à projet DotImaging sur Github: https://github.com/dajuric/dot-imaging

var reader = new CameraCapture(); //create camera/file/image-directory capture 
reader.Open(); 
var frame = reader.ReadAs<Bgr<byte>>(); //read single frame 
reader.Close(); 

et un échantillon plus détaillé: https://github.com/dajuric/dot-imaging/blob/master/Samples/Capture/Program.cs

Le paquet NuGet est disponible chez: https://www.nuget.org/packages/DotImaging.IO/

C'est assez facile.

Questions connexes