Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 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("");
     }
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
        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);
        }