本文整理汇总了C#中ImageMagick.MagickImage.GetDefine方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImage.GetDefine方法的具体用法?C# MagickImage.GetDefine怎么用?C# MagickImage.GetDefine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMagick.MagickImage
的用法示例。
在下文中一共展示了MagickImage.GetDefine方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_PreserveiCCP_SwapBytes
public void Test_PreserveiCCP_SwapBytes()
{
PngReadDefines defines = new PngReadDefines()
{
PreserveiCCP = true,
SwapBytes = false
};
using (MagickImage image = new MagickImage())
{
image.SetDefines(defines);
Assert.AreEqual("True", image.GetDefine(MagickFormat.Png, "preserve-iCCP"));
Assert.AreEqual(null, image.GetDefine(MagickFormat.Png, "swap-bytes"));
}
defines = new PngReadDefines()
{
PreserveiCCP = false,
SwapBytes = true
};
using (MagickImage image = new MagickImage())
{
image.SetDefines(defines);
Assert.AreEqual(null, image.GetDefine(MagickFormat.Png, "preserve-iCCP"));
Assert.AreEqual("True", image.GetDefine(MagickFormat.Png, "swap-bytes"));
}
}
示例2: Test_DctMethod_OptimizeCoding_Quality_QuantizationTables_SamplingFactors
public void Test_DctMethod_OptimizeCoding_Quality_QuantizationTables_SamplingFactors()
{
JpegWriteDefines defines = new JpegWriteDefines()
{
DctMethod = DctMethod.Fast,
OptimizeCoding = false,
Quality = new MagickGeometry(80, 80),
QuantizationTables = @"C:\path\to\file.xml",
SamplingFactors = new MagickGeometry[]
{
new MagickGeometry(5, 10),
new MagickGeometry(15, 20)
}
};
using (MagickImage image = new MagickImage(Files.Builtin.Logo))
{
image.SetDefines(defines);
Assert.AreEqual("Fast", image.GetDefine(MagickFormat.Jpeg, "dct-method"));
Assert.AreEqual("False", image.GetDefine(MagickFormat.Jpeg, "optimize-coding"));
Assert.AreEqual("80x80", image.GetDefine(MagickFormat.Jpeg, "quality"));
Assert.AreEqual(@"C:\path\to\file.xml", image.GetDefine(MagickFormat.Jpeg, "q-table"));
Assert.AreEqual("5x10,15x20", image.GetDefine(MagickFormat.Jpeg, "sampling-factor"));
}
}
示例3: Test_UseCropBox_UseTrimBox
public void Test_UseCropBox_UseTrimBox()
{
PdfReadDefines defines = new PdfReadDefines()
{
UseCropBox = true,
UseTrimBox = false
};
using (MagickImage image = new MagickImage())
{
image.SetDefines(defines);
Assert.AreEqual("True", image.GetDefine(MagickFormat.Pdf, "use-cropbox"));
Assert.AreEqual("False", image.GetDefine(MagickFormat.Pdf, "use-trimbox"));
}
}
示例4: Test_ClusterFit_Mipmaps_WeightByAlpha
public void Test_ClusterFit_Mipmaps_WeightByAlpha()
{
DdsWriteDefines defines = new DdsWriteDefines()
{
ClusterFit = true,
Mipmaps = 0,
WeightByAlpha = false,
};
using (MagickImage image = new MagickImage(Files.Builtin.Logo))
{
image.SetDefines(defines);
Assert.AreEqual("True", image.GetDefine(MagickFormat.Dds, "cluster-fit"));
Assert.AreEqual("0", image.GetDefine(MagickFormat.Dds, "mipmaps"));
Assert.AreEqual("False", image.GetDefine(MagickFormat.Dds, "weight-by-alpha"));
}
}
示例5: Test_FillOrder_RowsPerStrip
public void Test_FillOrder_RowsPerStrip()
{
TiffWriteDefines defines = new TiffWriteDefines()
{
FillOrder = Endian.LSB,
RowsPerStrip = 42,
TileGeometry = new MagickGeometry(100, 100)
};
using (MagickImage image = new MagickImage(Files.Builtin.Logo))
{
image.SetDefines(defines);
Assert.AreEqual("LSB", image.GetDefine(MagickFormat.Tiff, "fill-order"));
Assert.AreEqual("42", image.GetDefine(MagickFormat.Tiff, "rows-per-strip"));
Assert.AreEqual("100x100", image.GetDefine(MagickFormat.Tiff, "tile-geometry"));
}
}
示例6: Test_BlockSmoothing_DctMethod_FancyUpsampling
public void Test_BlockSmoothing_DctMethod_FancyUpsampling()
{
MagickReadSettings settings = new MagickReadSettings()
{
Defines = new JpegReadDefines()
{
BlockSmoothing = true,
DctMethod = DctMethod.Slow,
FancyUpsampling = false
}
};
using (MagickImage image = new MagickImage())
{
image.Read(Files.ImageMagickJPG, settings);
Assert.AreEqual("True", image.GetDefine(MagickFormat.Jpeg, "block-smoothing"));
Assert.AreEqual("Slow", image.GetDefine(MagickFormat.Jpeg, "dct-method"));
Assert.AreEqual("False", image.GetDefine(MagickFormat.Jpeg, "fancy-upsampling"));
}
}
示例7: Test_SkipProfiles
public void Test_SkipProfiles()
{
MagickReadSettings settings = new MagickReadSettings()
{
Defines = new PngReadDefines()
{
SkipProfiles = ProfileTypes.Xmp | ProfileTypes.Exif
}
};
using (MagickImage image = new MagickImage())
{
image.Read(Files.FujiFilmFinePixS1ProPNG);
Assert.IsNotNull(image.GetExifProfile());
Assert.IsNotNull(image.GetXmpProfile());
image.Read(Files.FujiFilmFinePixS1ProPNG, settings);
Assert.IsNull(image.GetExifProfile());
Assert.IsNull(image.GetXmpProfile());
Assert.AreEqual("Exif,Xmp", image.GetDefine(MagickFormat.Unknown, "profile:skip"));
}
}
示例8: Test_Define
public void Test_Define()
{
using (MagickImage image = new MagickImage(Files.Builtin.Logo))
{
string option = "optimize-coding";
image.SetDefine(MagickFormat.Jpg, option, true);
Assert.AreEqual("true", image.GetDefine(MagickFormat.Jpg, option));
Assert.AreEqual("true", image.GetDefine(MagickFormat.Jpeg, option));
image.RemoveDefine(MagickFormat.Jpeg, option);
Assert.AreEqual(null, image.GetDefine(MagickFormat.Jpg, option));
image.SetDefine(MagickFormat.Jpeg, option, "test");
Assert.AreEqual("test", image.GetDefine(MagickFormat.Jpg, option));
Assert.AreEqual("test", image.GetDefine(MagickFormat.Jpeg, option));
image.RemoveDefine(MagickFormat.Jpg, option);
Assert.AreEqual(null, image.GetDefine(MagickFormat.Jpeg, option));
image.SetDefine(MagickFormat.Unknown, "profile:skip", "ICC");
Assert.AreEqual("ICC", image.GetDefine(MagickFormat.Unknown, "profile:skip"));
}
}
示例9: Test_SkipProfiles
public void Test_SkipProfiles()
{
MagickReadSettings settings = new MagickReadSettings()
{
Defines = new JpegReadDefines()
{
SkipProfiles = ProfileTypes.Iptc | ProfileTypes.Icc
}
};
using (MagickImage image = new MagickImage())
{
image.Read(Files.FujiFilmFinePixS1ProJPG);
Assert.IsNotNull(image.GetIptcProfile());
image.Read(Files.FujiFilmFinePixS1ProJPG, settings);
Assert.IsNull(image.GetIptcProfile());
Assert.AreEqual("Icc,Iptc", image.GetDefine(MagickFormat.Unknown, "profile:skip"));
}
}