Example #1
0
        public byte[] GetImg(int id)
        {
            var           c   = camers; // AntiRace
            CameraWithImg img = c.FirstOrDefault(x => x.Camera.Id == id);

            return(img?.Img);
        }
Example #2
0
        public byte[] GetImg(int brigadeId, int cameraNumber)
        {
            var           c   = camers; // AntiRace
            CameraWithImg img = c.FirstOrDefault(x => x.Camera.BrigadeId == brigadeId && x.Camera.Num == cameraNumber);

            return(img?.Img);
        }
Example #3
0
 private void DownloadImg(CameraWithImg item, Uri src)
 {
     try
     {
         using (var client = new WebClient())
         {
             byte[] data = client.DownloadData(src);
             item.Img = data;
         }
     }
     catch (Exception e)
     {
         logger.Error(e, $"Can not downloaded img from {src.AbsolutePath}");
     }
 }