Webcam Extension

Free

An extension for using Webcams in your LightSwitch applications and capture pictures that can be assigned to properties of type Image.

(15) Review
Visual Studio
2012, 2010
Download (4,454)
11/4/2011
1.0
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (15)
Q and A (2)
Sign in to write a review
Sort by:

by Marek Dedecius | January 09 2014

Thank for your greate extension.

Pleas could you make a build for Visual Studio 2013 or if you share your source code, could buld it.

Thank you

by Harshal B | February 19 2013

simple and powerful extension. great work, thanks.

by Dave A Gordon | October 29 2012

by AAKoken | September 10 2012

by .Net Dreamer | April 18 2012

Alright, thanks to Milton Miranda Neto, for his code. At last i did suceed in c# using this extension. You can watch this http://youtu.be/-V0xiyQcYaM video for more help.

by Idrees Khan | April 07 2012

Please provide your code in c# as well. It will then be much helpful.

by Jewel Lambert | March 19 2012

Great stuff! Thanks!

Very f... amazing man!!! Congrats!

by TZ Dev | January 30 2012

I tried testing your extension in csharp but this line gave me an error...

this.Cadastro_Clientes.SelectedItem.Foto = this.WebCam.CapturedImage;

help me please...

by Milton Miranda Neto | January 27 2012

If you want a C# issue:

private WebcamControl WebCam;

partial void CadastroClientes_Created()
{
var Ctrl = this.FindControl(​"ScreenContent"​);
Ctrl.ControlAvailable += new EventHandler<ControlAvailableEventArgs>(WebCamHandler);
}

public void WebCamHandler(object sender, ControlAvailableEventArgs e)
{
this.WebCam = (WebcamControl)e.Control;
this.WebCam.CaptureCompleted += new WebcamControl.CaptureCompletedEventHandler(WebCam_CaptureCompleted);
}

public void WebCam_CaptureCompleted()
{
this.Cadastro_Clientes.SelectedItem.Foto = this.WebCam.CapturedImage;
}

by Jan Van der Haegen | January 25 2012

Amazing. My jaw literally dropped open!
I can see so much value for our customers!

by Rodrigo Adelino | November 11 2011

amazing,,, thks Del Sole

by Oliver Michalski | November 06 2011

Great Work - Thanks :-)

by ADefwebserver | November 04 2011

This is an example of pushing LightSwitch and opening people's minds to what it can do.

by Daniel Cheida | November 04 2011

Great Extension! It will be very helpful for me. Congratulations!

Sign in to start a discussion


  • Mi código a C#
    1 Posts | Last post May 22, 2013
    • using System;
      using System.Linq;
      using System.IO;
      using System.IO.IsolatedStorage;
      using System.Collections.Generic;
      using Microsoft.LightSwitch;
      using Microsoft.LightSwitch.Framework.Client;
      using Microsoft.LightSwitch.Presentation;
      using Microsoft.LightSwitch.Presentation.Extensions;
      using WebcamExtension.Presentation.Controls;
      namespace LightSwitchApplication
      {
          public partial class CreateNewCustomer
          {
              /// <summary>
              /// Initializes a new customer object and assigns it to the CustomerProperty for the screen.
              /// </summary>
      
              WebcamControl webCam;
      
              partial void CreateNewCustomer_InitializeDataWorkspace(global::System.Collections.Generic.List<global::Microsoft.LightSwitch.IDataService> saveChangesTo)
              {
                  // Write your code here.
                  this.CustomerProperty = new Customer();            
              }
              /// <summary>
              /// Closes the Create New Customer screen after saving and focuses to the originating screen.
              /// </summary>
              partial void CreateNewCustomer_Saved()
              {
                  // Write your code here.
                  this.Close(false);
                  Application.Current.ShowDefaultScreen(this.CustomerProperty);
              }
      
              partial void CreateNewCustomer_Created()
              {            
                  IContentItemProxy ctl = this.FindControl("ScreenContent");
                  ctl.ControlAvailable += new EventHandler<ControlAvailableEventArgs>(CapturaControl);
              }
      
              private void CapturaControl(Object sender, ControlAvailableEventArgs e)
              {
                  webCam = ((WebcamControl)e.Control);
                  webCam.CaptureCompleted += new WebcamControl.CaptureCompletedEventHandler(webCam_CaptureCompleted);
              }
      
              private void webCam_CaptureCompleted()
              {
                  CustomerProperty.Picture = webCam.CapturedImage;
              }
          }
      }
  • Get Image button does not get the pic for me.
    6 Posts | Last post August 09, 2012
    • Hi,
        Can you please update on how exactly should I use this control. I created a local Image type property & changed the control type to this control.
      When I start the cam & click on get Image nothing happens.
      Am I missing something here?
      Kindly let me know if there is something that needs to be done in order to hook the image to an existing User profile.
      Regards
      Supreet
    • Hi, did you watch the video on the extension's home page? :-)
      You must not replace the Image type control, leave it unchanged. Simply add a new custom control and change this to use the extension. The control returns an image that can be assigned to the Image type.
      
      All the best.
    • Hi, 
      if I use the control within a modalwindow, and closing it without clicking [Stop] and open it again and click the [Start] I get an error saying that the webcam is being used already. how can I solve this problem?
    • I create the solution.
      
      ' ---------- ModalWindow webcam ----------
              Private WithEvents WebCam As WebcamControl
      
              Private Sub Funcionarios_Created()
                  Dim Ctrl = Me.FindControl("ScreenContent")
                  AddHandler Ctrl.ControlAvailable, Sub(sender As Object, e As ControlAvailableEventArgs)
                                                        Me.WebCam = CType(e.Control, WebcamControl)
                                                    End Sub
              End Sub
      
              Private Sub WebCam_CaptureCompleted() Handles WebCam.CaptureCompleted
                  Me.Funcionarios1.SelectedItem.Foto = Me.WebCam.CapturedImage
              End Sub
      
              Private Sub CarregarFotoDaWebCam_Execute()
                  Dim Ctrl = Me.FindControl("WebCamModalWindow")
                  AddHandler Ctrl.ControlAvailable, Sub(sender As Object, e As ControlAvailableEventArgs)
                                                        Dim Cw As ChildWindow = CType(e.Control, ChildWindow)
                                                        AddHandler Cw.Closing, Sub(sender2 As Object, e2 As EventArgs)
                                                                                   Me.WebCam.capSource.Stop()
                                                                               End Sub
                                                    End Sub
                  Me.OpenModalWindow("WebCamModalWindow")
              End Sub
      
              Private Sub FotoOK_Execute()
                  Me.CloseModalWindow("WebCamModalWindow")
              End Sub
    • Hello Marden, did you have this sample using C#?
    • El excelente ejemplo de Alessandro Del Sole para WebCam Extension 
      (http://visualstudiogallery.msdn.microsoft.com/6beb1508-e025-420b-a01c-677aad550ac6) en VB.Net, traducido por mi
      a  C#. Muchas Gracias Alessandro
      
      To forgive for the translation the Englishman - translated by the web.
      for WebCam Extension (http: // visualstudiogallery.msdn.microsoft.com/6beb1508-e025-420b-a01c-677aad550ac6) in VB.Net,
       translated for my to C. 
      Thank you very much Alessandro
      
      ----------------------------------------------------------------------------------------------------------------
      using System.Linq;
      using System.IO;
      using System.IO.IsolatedStorage;
      using System.Collections.Generic;
      using Microsoft.LightSwitch;
      using Microsoft.LightSwitch.Framework.Client;
      using Microsoft.LightSwitch.Presentation;
      using Microsoft.LightSwitch.Presentation.Extensions;
      using WebcamExtension.Presentation.Controls;
      namespace LightSwitchApplication
      {
          public partial class NuevoContacto
          {
              private WebcamControl webCam;
              partial void NuevoContacto_InitializeDataWorkspace(global::System.Collections.Generic.List<global::Microsoft.LightSwitch.IDataService> saveChangesTo)
              {
                  this.ContactosProperty = new Contactos();
              }
              partial void NuevoContacto_Saved()
              {
                  this.Close(false);
                  Application.Current.ShowDefaultScreen(this.ContactosProperty);
              }
              partial void NuevoContacto_Created()
              {
                  var ctrl = this.FindControl("ScreenContent");
                  ctrl.ControlAvailable += (object sender, ControlAvailableEventArgs e) =>
                  {
                      this.webCam = (WebcamControl)e.Control;
                  };
              }
              private void webCam_CaptureCompleted()
              {
                  this.ContactosProperty.Foto = this.webCam.CapturedImage;
              }
              partial void NuevoContacto_Activated()
              {
                  webCam.CaptureCompleted += webCam_CaptureCompleted;
              }
          }
      }