[Mono-list] Mono + Webcam (cross-platform solution)?
luis adrian rodriguez muñoz
luisadrianmr83 at gmail.com
Fri Oct 8 18:21:10 EDT 2010
#First we need to install the Emgu.CV dll (that makes almost #all the magic)
#I made i little example, we need two controls a Gtk.Image #control and a
Gdk.PixBuf and also the System.IO; and #System.Drawing;
#Ok here is the example in Gtk.Window
#When we start the form we are gona use a timer for mono
public MainWindow () : base(Gtk.WindowType.Toplevel)
{
GLib.Timeout.Add (180, new GLib.TimeoutHandler (update_status));
##This is the event
private bool update_status ()
{
Image<Bgr, Byte> Photo=capture.QueryFrame();
viewer.Image = Photo;
bitmap = viewer.Image.Bitmap;
MemoryStream memor = new MemoryStream ();
bitmap.Save(memor,ImageFormat.Png);
pix = new Gdk.Pixbuf(memor.ToArray());
this.image2.Pixbuf = pix;
memor.Dispose();
return true;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20101008/e05b02fb/attachment.html
More information about the Mono-list
mailing list