Esempio n. 1
0
 private void HandlePictureGroup(PhotoGroup photoGroup)
 {
     using (Bitmap newPic = photoModifier.CombinePicture(photoGroup))
     {
         fileWriter.SavePic(photoGroup, newPic);
     }
 }
Esempio n. 2
0
 public bool SavePic(PhotoGroup group, Bitmap newPic)
 {
     if (newPic == null)
     {
         return false;
     }
     string outputPath = BuildPath(group);
     return SavePic(outputPath, newPic);
 }
Esempio n. 3
0
 private string BuildPath(PhotoGroup group)
 {
     string outputPath = string.Format("{0}\\{1}\\{2}\\{3}\\", setting.OverviewFolderBasePath, "Scan Overview", group.Date.ToString("yyyyMMdd"), group.CustomSeqNum);
     outputPath += group.ScanSeqNum + ".jpg";
     return outputPath;
 }
Esempio n. 4
0
        private PhotoGroup CreatePhotoGroup(VisitorItem item)
        {
            DirectoryInfo dir = item.CurrentDir;

            if (!File.Exists(dir.FullName + "\\" + settings.FrontPictureName) || !File.Exists(dir.FullName + "\\" + settings.FrontPictureName))
            {
                log.LogInfo(string.Format("Did not find {0} or {1} in folder {2}.", settings.FrontPictureName, settings.BackPictureName, dir.FullName));
                return null;
                //log
            }

            PhotoGroup pg = new PhotoGroup
            {
                Date = DateTime.ParseExact((string)item.Info[visitorKey_ScanDate], "yyyyMMdd", null),
                CustomSeqNum = item.Info[visitorKey_CustomSeqNum] as string,
                ScanSeqNum = item.Info[visitorKey_ScanSeqNum] as string,
                Front = new Photo()
                {
                    Name = settings.FrontPictureName,
                    FullPath = item.CurrentDir.FullName + "\\" + settings.FrontPictureName
                },
                Back = new Photo()
                {
                    Name = settings.BackPictureName,
                    FullPath = item.CurrentDir.FullName + "\\" + settings.BackPictureName
                }
            };
            
            log.LogInfo(string.Format("Created photo group with {0} and {1} in folder {2}. Date={3}, CustomSeqNum={4}, ScanSeqNum={5}",
                settings.FrontPictureName, settings.BackPictureName, dir.FullName, pg.Date, pg.CustomSeqNum, pg.ScanSeqNum));  
            return pg;
        }