コード例 #1
0
ファイル: Main.cs プロジェクト: 0msGithub/Tourist
        private void setImageListView(string[] filelist)
        {
            //detailView.Clear();
            foreach (string objFile in filelist)
            {
                // Exif Format을 가진 이미지파일만 작업 수행
                if (Tourist.TouristBasicUtil.checkExifFile(objFile))
                {
                    Tourist.PropertyFileInfo pf = Tourist.TouristFileInfo.getFileInfo(objFile);
                    FileListView = new ListViewItem(pf.filename);
                    FileListView.SubItems.Add("test");
                    FileListView.SubItems.Add(Tourist.TouristBasicUtil.GetFileSize(pf.filesize));
                    detailView.Items.Add(FileListView);
                    FileStream fs = new FileStream(objFile, FileMode.Open, FileAccess.Read);
                    IEnumerable <MetadataExtractor.Directory> directories = ImageMetadataReader.ReadMetadata(fs);
                    var    subIfdDirectory = directories.OfType <MetadataExtractor.Formats.Exif.GpsDirectory>().FirstOrDefault();
                    var    gpsLatitude     = subIfdDirectory?.GetDescription(MetadataExtractor.Formats.Exif.GpsDirectory.TagLatitude);
                    var    gpsLongitude    = subIfdDirectory?.GetDescription(MetadataExtractor.Formats.Exif.GpsDirectory.TagLongitude);
                    double Latitude        = Tourist.TouristBasicUtil.ConvertGPSLocation(subIfdDirectory?.GetDescription(MetadataExtractor.Formats.Exif.GpsDirectory.TagLatitude));
                    double Longitude       = Tourist.TouristBasicUtil.ConvertGPSLocation(subIfdDirectory?.GetDescription(MetadataExtractor.Formats.Exif.GpsDirectory.TagLongitude));

                    TouristGmap.Overlays.Add(SetMarkers(Latitude, Longitude));
                }
                detailView.EndUpdate();
                if (detailView.Items.Count == 0)
                {
                    detailViewLabel.Visible = true;
                }
                else
                {
                    detailViewLabel.Visible = false;
                }
            }
        }
コード例 #2
0
 private void setImageListView(string[] filelist)
 {
     //detailView.Clear();
     foreach (string objFile in filelist)
     {
         // Exif Format을 가진 이미지파일만 작업 수행
         if (Tourist.TouristBasicUtil.checkExifFile(objFile))
         {
             Tourist.PropertyFileInfo pf = Tourist.TouristFileInfo.getFileInfo(objFile);
             FileListView = new ListViewItem(pf.filename);
             FileListView.SubItems.Add("test");
             FileListView.SubItems.Add(Tourist.TouristBasicUtil.GetFileSize(pf.filesize));
             detailView.Items.Add(FileListView);
         }
     }
     detailView.EndUpdate();
     if (detailView.Items.Count == 0)
     {
         detailViewLabel.Visible = true;
     }
     else
     {
         detailViewLabel.Visible = false;
     }
 }
コード例 #3
0
ファイル: TouristFileInfo.cs プロジェクト: 0msGithub/Tourist
        // 해당파일의 기본정보를 가져오는 메소드
        public static PropertyFileInfo getFileInfo(string filePath)
        {
            PropertyFileInfo pf = new PropertyFileInfo();

            pf.filename = Path.GetFileName(filePath);

            FileInfo fi = new FileInfo(filePath);

            pf.filesize = fi.Length;
            return(pf);
        }
コード例 #4
0
ファイル: TouristFileInfo.cs プロジェクト: GeonPark/Tourist
        // 해당파일의 기본정보를 가져오는 메소드
        public static PropertyFileInfo getFileInfo(string filePath)
        {
            PropertyFileInfo pf = new PropertyFileInfo();

            FileInfo fi = new FileInfo(filePath);

            pf.Filesize       = fi.Length;
            pf.CreateTime     = fi.CreationTime;
            pf.LastAccessTime = fi.LastAccessTime;
            pf.LastWriteTime  = fi.LastWriteTime;
            pf.Filename       = Path.GetFileName(filePath);

            return(pf);
        }
コード例 #5
0
ファイル: Main.cs プロジェクト: ExploitFormeTeam/Tourist
        private void setImageListView(string[] filelist)
        {
            // 이미지 분석결과값 리스트 초기화
            result = new List <Tourist.ExifValue>();

            // 리스트뷰 초기화
            detailView.Items.Clear();

            // GMap 초기화
            TouristGmap.Overlays.Clear();
            InitGMap();

            foreach (string objFile in filelist)
            {
                // Exif Format을 가진 이미지파일만 작업 수행
                if (Tourist.TouristBasicUtil.checkExifFile(objFile))
                {
                    Tourist.PropertyFileInfo pf = Tourist.TouristFileInfo.getFileInfo(objFile);
                    Tourist.ExifValue        ef = Tourist.TouristExifParser.getImageInfo(objFile);

                    FileListView = new ListViewItem(pf.Filename);
                    FileListView.SubItems.Add(Tourist.TouristBasicUtil.GetFileSize(pf.Filesize));
                    FileListView.SubItems.Add(pf.CreateTime.ToString());
                    FileListView.SubItems.Add(pf.LastWriteTime.ToString());
                    FileListView.SubItems.Add(pf.LastAccessTime.ToString());
                    detailView.Items.Add(FileListView);

                    setGMapMarker(ef.Latitue, ef.Longitude, pf.Filename);
                    result.Add(ef);
                }
            }
            // 초기 Marker가 겹치는 현상때문에 Zoom으로 맵리로딩
            TouristGmap.Zoom = 6;
            detailView.EndUpdate();
            if (detailView.Items.Count == 0)
            {
                detailViewLabel.Visible = true;
            }
            else
            {
                detailViewLabel.Visible = false;
            }
        }