예제 #1
0
        public static void Main()
        {
            var    parser = new ImageParser();
            string imageInfoJson;

            using (var file = new FileStream("image.png", FileMode.Open, FileAccess.Read))
            {
                imageInfoJson = parser.GetImageInfo(file);
            }

            Console.WriteLine(imageInfoJson);

            using (var file = new FileStream("image1.bmp", FileMode.Open, FileAccess.Read))
            {
                imageInfoJson = parser.GetImageInfo(file);
            }

            Console.WriteLine(imageInfoJson);

            using (var file = new FileStream("image2.gif", FileMode.Open, FileAccess.Read))
            {
                imageInfoJson = parser.GetImageInfo(file);
            }

            Console.WriteLine(imageInfoJson);
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var    parser = new ImageParser();
            string imageInfoJson;

            //using (var file = new FileStream("C:\\Users\\Вера\\Downloads\\ImageParser.csproj\\2GU.gif", FileMode.Open, FileAccess.Read))
            using (var file = new FileStream("image.png", FileMode.Open, FileAccess.Read))
            {
                imageInfoJson = parser.GetImageInfo(file);
            }

            Console.WriteLine(imageInfoJson);
        }
예제 #3
0
파일: Program.cs 프로젝트: Sapfir0/kontur
        public static void Main(string[] args)
        {
            var           parser = new ImageParser();
            string        imageInfoJson;
            List <string> files = new List <string> {
                "image.png", "BMP.bmp"
            };

            foreach (var filename in files)
            {
                using (var file = new FileStream(filename, FileMode.Open, FileAccess.Read))  {
                    imageInfoJson = parser.GetImageInfo(file);
                }
                Console.WriteLine(imageInfoJson);
            }
        }
예제 #4
0
        public static void Main(string[] args)
        {
            var    parser = new ImageParser();
            string imageInfoJson;

            using (var file = new FileStream("image.png", FileMode.Open, FileAccess.Read))
            {
                imageInfoJson = parser.GetImageInfo(file);
            }

            Console.WriteLine(imageInfoJson);

            /*
             *  string[] lines = imageInfoJson.Split(new char[] { '\n' },
             *                         StringSplitOptions.RemoveEmptyEntries);
             * foreach (var e in lines)
             *  Console.WriteLine(e.Length);
             * Console.WriteLine(lines[0].Substring(1));*/
            Console.ReadLine();
        }
예제 #5
0
 public void SetUp()
 {
     parser = new ImageParser();
 }