Пример #1
0
        private void localizarimagem()
        {
            try
            {
                if ((bsParamGer.Current != null) && ((vTP_Modo == TTpModo.tm_Insert) || (vTP_Modo == TTpModo.tm_Edit)))
                {
                    OpenFileDialog ofd = new OpenFileDialog();
                    ofd.Filter = "IMAGENS|*.jpg";

                    if (ofd.ShowDialog() == DialogResult.OK)
                    {
                        if (System.IO.File.Exists(ofd.FileName))
                        {
                            System.Drawing.Image acc_img = Image.FromFile(ofd.FileName);


                            pictureBox6.Image    = acc_img;
                            pictureBox6.SizeMode = PictureBoxSizeMode.StretchImage;


                            (bsParamGer.Current as TRegistro_ParamGer).Img = Convercao_imagem.imageToByteArray(acc_img);
                        }
                    }
                }
            }
            catch { }
        }
Пример #2
0
 private void capturarImagem()
 {
     using (WebCamLibrary.TFCapturaVideo fCap = new WebCamLibrary.TFCapturaVideo())
     {
         if (fCap.ShowDialog() == DialogResult.OK)
         {
             pictureBox6.Image    = fCap.Img;
             pictureBox6.SizeMode = PictureBoxSizeMode.StretchImage;
             (bsParamGer.Current as TRegistro_ParamGer).Img = Convercao_imagem.imageToByteArray(fCap.Img);
         }
     }
 }
Пример #3
0
        private void capturarImagem()
        {
            if (camera != null)
            {
                try
                {
                    System.IO.MemoryStream st = new System.IO.MemoryStream(camera.GrabFrame());


                    System.Drawing.Image acc_img = System.Drawing.Image.FromStream(st);

                    pictureBox6.Image    = acc_img;
                    pictureBox6.SizeMode = PictureBoxSizeMode.StretchImage;


                    (bsParamGer.Current as TRegistro_ParamGer).Img = Convercao_imagem.imageToByteArray(acc_img);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }