Beispiel #1
0
        public static void Run()
        {
            //ExStart:ReadAllEXIFTags
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_JPEG();

            using (JpegImage image = (JpegImage)Image.Load(dataDir + "aspose-logo.jpg"))
            {
                JpegExifData   exifData   = image.ExifData;
                Type           type       = exifData.GetType();
                PropertyInfo[] properties = type.GetProperties();
                foreach (PropertyInfo property in properties)
                {
                    Console.WriteLine(property.Name + ":" + property.GetValue(exifData, null));
                }
            }
            //ExEnd:ReadAllEXIFTags
        }
        public static void Run()
        {
            // ExStart:WritingAndModifyingEXIFData
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_JPEG();

            // Load an image using the factory method Load exposed by Image class
            using (Image image = Image.Load(dataDir + "aspose-logo.jpg"))
            {
                // Initialize an object of ExifData and fill it will image's EXIF information
                JpegExifData exif = ((JpegImage)image).ExifData;

                // Set LensMake, WhiteBalance, Flash information Save the image
                exif.LensMake     = "Sony";
                exif.WhiteBalance = ExifWhiteBalance.Auto;
                exif.Flash        = ExifFlash.Fired;
                image.Save(dataDir + "aspose-logo_out.jpg");
            }
            // ExEnd:WritingAndModifyingEXIFData
        }
        public static void Run()
        {
            //ExStart:ReadJpegEXIFTags
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_JPEG();

            Console.WriteLine("Running example ReadJpegEXIFTags");
            using (JpegImage image = (JpegImage)Image.Load(dataDir + "aspose-logo.jpg"))
            {
                JpegExifData exifData = image.ExifData;
                Console.WriteLine("Camera Owner Name: " + exifData.CameraOwnerName);
                Console.WriteLine("Aperture Value: " + exifData.ApertureValue);
                Console.WriteLine("Orientation: " + exifData.Orientation);
                Console.WriteLine("Focal Length: " + exifData.FocalLength);
                Console.WriteLine("Compression: " + exifData.Compression);
            }

            Console.WriteLine("Finished example ReadJpegEXIFTags");
            //ExEnd:ReadJpegEXIFTags
        }