Example #1
0
 private async void TomarFotoLoad(TomarFotoSenaParticularView Window = null)
 {
     try
     {
         if (!((System.Windows.UIElement)(Window.TomarFotoSenaParticularWindow)).IsVisible)
         {
             return;
         }
         CamaraWeb = new WebCam(new WindowInteropHelper(Application.Current.Windows[0]).Handle);
         await CamaraWeb.InitializeWebCam(new List <System.Windows.Controls.Image> {
             Window.ImgSenaParticular
         });
     }
     catch (Exception ex)
     {
         StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al cargar cámara", ex);
     }
 }
Example #2
0
        private async void TomarFotoLoad(TomarFotoSenaParticularView Window = null)
        {
            try
            {
                if (!((System.Windows.UIElement)(Window.TomarFotoSenaParticularWindow)).IsVisible)
                {
                    return;
                }
                CamaraWeb = new ControlPenales.Clases.WebCam(new WindowInteropHelper(Application.Current.Windows[0]).Handle);
                await CamaraWeb.InitializeWebCam(new List <System.Windows.Controls.Image> {
                    Window.ImgSenaParticular
                });

                if (ImagenEmpleado.Length != 1882)
                {
                    CamaraWeb.AgregarImagenControl(Window.ImgSenaParticular, new Imagenes().ConvertByteToImageSource(ImagenEmpleado));
                }
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al cargar la pantalla para tomar foto.", ex);
            }
        }