本文整理汇总了C#中ImageMagick.MagickImage.GetAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImage.GetAttribute方法的具体用法?C# MagickImage.GetAttribute怎么用?C# MagickImage.GetAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMagick.MagickImage
的用法示例。
在下文中一共展示了MagickImage.GetAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_Info
public void Test_Info()
{
using (MagickImage image = new MagickImage(Files.MagickNETIconPNG))
{
image.AddProfile(ColorProfile.USWebCoatedSWOP);
Assert.AreEqual("U.S. Web Coated (SWOP) v2", image.GetAttribute("icc:description"));
Assert.AreEqual("U.S. Web Coated (SWOP) v2", image.GetAttribute("icc:manufacturer"));
Assert.AreEqual("U.S. Web Coated (SWOP) v2", image.GetAttribute("icc:model"));
Assert.AreEqual("Copyright 2000 Adobe Systems, Inc.", image.GetAttribute("icc:copyright"));
}
}
示例2: Test_IgnoreExifPoperties
public void Test_IgnoreExifPoperties()
{
MagickReadSettings settings = new MagickReadSettings()
{
Defines = new TiffReadDefines()
{
IgnoreExifPoperties = true
}
};
using (MagickImage image = new MagickImage())
{
image.Read(Files.InvitationTif);
Assert.IsNotNull(image.GetAttribute("exif:PixelXDimension"));
image.Read(Files.InvitationTif, settings);
Assert.IsNull(image.GetAttribute("exif:PixelXDimension"));
}
}
示例3: Test_Attribute
public void Test_Attribute()
{
using (MagickImage image = new MagickImage(Files.ImageMagickJPG))
{
Assert.IsNull(image.GetAttribute("test"));
IEnumerable<string> names = image.AttributeNames;
Assert.AreEqual(4, names.Count());
image.SetAttribute("test", "");
Assert.AreEqual(null, image.GetAttribute("test"));
image.SetAttribute("test", "123");
Assert.AreEqual("123", image.GetAttribute("test"));
image.SetArtifact("foo", "bar");
names = image.AttributeNames;
Assert.AreEqual(5, names.Count());
Assert.AreEqual("date:create,date:modify,jpeg:colorspace,jpeg:sampling-factor,test", string.Join(",", (from name in names
orderby name
select name).ToArray()));
}
}