Ejemplo n.º 1
0
        public void CopyMetadata()
        {
            TestRuntime.AssertXcodeVersion(5, 0);

            using (var imageSource = CGImageSource.FromUrl(NSUrl.FromFilename(filename))) {
                CGImageOptions options = new CGImageOptions()
                {
                    ShouldCacheImmediately = true
                };
                using (CGImageMetadata metadata = imageSource.CopyMetadata(0, options)) {
                    Console.WriteLine();
                }
            }
        }
Ejemplo n.º 2
0
        public void Defaults()
        {
            TestRuntime.AssertXcodeVersion(5, 0);

            Assert.Throws <ArgumentNullException> (delegate { new CGImageMetadata(null); }, "null");

            using (var mutable = new CGMutableImageMetadata())
                using (var tag = new CGImageMetadataTag(nspace, prefix, name, CGImageMetadataType.Default, true)) {
                    mutable.SetTag(null, path, tag);

                    using (var meta = new CGImageMetadata(mutable.CreateXMPData())) {
                        // not surprising since it's all empty
                        Assert.Null(meta.CopyTagMatchingImageProperty(CGImageProperties.ExifDictionary, CGImageProperties.ExifDateTimeOriginal), "CopyTagMatchingImageProperty");
                    }
                }
        }
Ejemplo n.º 3
0
        public void CopyMetadata()
        {
            if (!TestRuntime.CheckSystemAndSDKVersion(7, 0))
            {
                Assert.Ignore("Only on iOS7+");
            }

            using (var imageSource = CGImageSource.FromUrl(NSUrl.FromFilename(filename))) {
                CGImageOptions options = new CGImageOptions()
                {
                    ShouldCacheImmediately = true
                };
                using (CGImageMetadata metadata = imageSource.CopyMetadata(0, options)) {
                    Console.WriteLine();
                }
            }
        }