public static Bitmap ConvertSampleToBitmap(Sample sample) { SampleConversion convertor = new SampleConversion(); Bitmap bmp = null; convertor.ConvertToPicture(sample, ref bmp); return(bmp); }
protected Bitmap ConvertSampleToBitmap(Sample sample) { var convertor = new SampleConversion(); // Create a sample convertor. Bitmap bitmap = null; // TODO: the size doesn't matter convertor.ConvertToPicture(sample, ref bitmap); // TODO: return bitmap as a result return(bitmap); }
protected Bitmap ConvertSampleToBitmap(Sample Sample) { /* TODO: Create a Convertor which will return a bitmap no matter the size */ SampleConversion Convertor = new SampleConversion(); Bitmap bitmap = null; Convertor.ConvertToPicture(Sample, ref bitmap); return(bitmap); }
public void CreateBitmapFile(string pathToSaveBitmapTo) { if (_sample == null) { throw new NullReferenceException("_sample"); } var sampleConvertor = new SampleConversion(); Bitmap bitmap = null; sampleConvertor.ConvertToPicture(_sample, ref bitmap); bitmap.Save(pathToSaveBitmapTo); }
public void OnComplete(object Capture, string ReaderSerialNumber, Sample Sample) { SampleConversion.ConvertToPicture(Sample, ref img); Dispatcher.BeginInvoke(new Action(() => { PictureBox.Source = BitmapToImageSource(img); // fit the image into the picture box --CaptureTimes; textBlock_status.Text = "Finger Print Sample Captured! Repeat for " + CaptureTimes.ToString() + " more time(s)"; })); //Enroll Created finger Print EnrollFingerFeatureSet(Sample); }
public void OnComplete(object Capture, string ReaderSerialNumber, Sample Sample) { this.Invoke(new Function(delegate() { this.imgDigital.Enabled = true; })); this.Invoke(new Function(delegate() { this.Cursor = Cursors.WaitCursor; })); sp.ConvertToPicture(Sample, ref img); FuncionarioService funServ = new FuncionarioService(context); funcionarios = new List <Funcionario>(); funcionarios = funServ.GetFuncionarios(); byte[] bytes = Sample.Bytes; Process(Sample); if (impressaoLocalizada) { if (funcionario != null) { if (funcionario.Id == 0) { return; } if ((impressaoLocalizada) && (funcionarioAnterior != null)) { if (funcionarioAnterior.Id == 0) { impressaoLocalizada = false; } if (funcionario.Id == funcionarioAnterior.Id) { HorarioExpediente horarioExpediente = new HorarioExpediente(); HorarioService serviceHorario = new HorarioService(context); horarioExpediente.Data = DateTime.Now.Date; HorarioExpediente ultimoHorario = serviceHorario.GetLastHorario(funcionario.Id); horarioExpediente.Funcionario = funcionario; if (ultimoHorario == null) { horarioExpediente.Entrada = DateTime.Now; horarioExpediente.Saida = new DateTime(); serviceHorario.Insert(horarioExpediente); updateStatus("Horário de entrada lançado com sucesso..."); } else { if ((ultimoHorario.Entrada != DateTime.MinValue) && (ultimoHorario.Saida == DateTime.MinValue)) { ultimoHorario.Saida = DateTime.Now; serviceHorario.Update(ultimoHorario); updateStatus("Horário de saída lançado com sucesso..."); } else { horarioExpediente.Entrada = DateTime.Now; horarioExpediente.Saida = new DateTime(); serviceHorario.Insert(horarioExpediente); updateStatus("Horário de entrada lançado com sucesso..."); } } funcionario = new Funcionario(); funcionarioAnterior = funcionario; this.Invoke(new Function(delegate() { limparTela(); })); cp.StopCapture(); cp = new DPFP.Capture.Capture(); cp.StartCapture(); cp.EventHandler = this; } } if ((impressaoLocalizada == false) || (funcionarioAnterior == null)) { PreencherTela(); updateStatus("Impressão digital localizada. \nPara efetuar o lançamento do ponto e coloque novamente o mesmo dedo no leitor."); funcionarioAnterior = funcionario; impressaoLocalizada = true; } else { impressaoLocalizada = false; } } else { updateStatus("Impressão digital não localizada. \nTente novamente."); funcionarioAnterior = null; impressaoLocalizada = false; } } else { funcionario = new Funcionario(); funcionarioAnterior = funcionario; this.Invoke(new Function(delegate() { limparTela(); })); cp.StopCapture(); cp = new DPFP.Capture.Capture(); cp.StartCapture(); cp.EventHandler = this; this.Invoke(new Function(delegate() { limparTela(); })); } this.Invoke(new Function(delegate() { this.Cursor = Cursors.Default; })); this.Invoke(new Function(delegate() { this.imgDigital.Enabled = false; })); }