public bool queryFrame(ref Bitmap bmp) { if (isOpen) { IntPtr frame = (IntPtr)null; bool res = RetrievalFrame(m_capture, ref frame); if (frame != null && res) { if (frame != null) { if (bmp != null) { bmp.Dispose(); } bmp = Ultis.ConvertIntPrToBitmap(frame); //release frame; Ultis.ReleaseImage(ref frame); if (bmp == null) { return(false); } return(true); } return(false); } //bmp.Dispose(); return(res); } return(false); }
private void button6_Click(object sender, EventArgs e) { fileName = Ultis.RemoveUnicode(emp.NAME) + "_" + CODE.TextDateString(dayStart) + "_" + CODE.TextDateString(dayEnd); frmWait = new frm_Wait("Đang xuất file excel " + BLL_PARA.PathExcel + fileName + ".xlsx"); exExcel = new Thread(export); exExcel.Start(); frmWait.ShowDialog(); }
public Bitmap DetectFaceImage(Bitmap bmp) { Bitmap result = null; Image <Bgr, byte> img = new Image <Bgr, byte>(bmp); IntPtr face; bool res = FD_DetectFaceImage(m_face_fd, img.Ptr, out face); if (res) { result = Ultis.ConvertIntPrToBitmap(face); img.Dispose(); Ultis.ReleaseImage(ref face); return(result); } return(result); }
private string saveImg(/*Bitmap bmp,*/ string name) { try { // Save Image string filename = BLL_PARA.PathHistory + Ultis.RemoveUnicode(DAL_EMPLOYEE.GetFullName(int.Parse(name))) + CODE.timeString(DateTime.Now) + ".Jpg"; //FileStream fstream = new FileStream(filename, FileMode.Create); //bmp.Save(fstream, System.Drawing.Imaging.ImageFormat.Jpeg); //fstream.Close(); return(filename); } catch (Exception) { return(""); } }
private bool saveImg(Bitmap bmp) { try { // Save Image string filename = BLL_PARA.PathFace + Ultis.RemoveUnicode(txt_HoTen.Text) + ".Jpg"; FileStream fstream = new FileStream(filename, FileMode.Create); bmp.Save(fstream, System.Drawing.Imaging.ImageFormat.Jpeg); fstream.Close(); return(true); } catch (Exception) { return(false); } }
public bool getFaceImage(int index, ref Bitmap bmp) { IntPtr frame; bool res = FT_getFaceImage(m_face_tracking, index, out frame); if (!res || frame == (IntPtr)0) { return(false); } if (bmp != null) { bmp.Dispose(); } bmp = Ultis.ConvertIntPrToBitmap(frame); Ultis.ReleaseImage(ref frame); return(res); }