public void Test_Transparent() { MagickColor red = new MagickColor("red"); MagickColor transparentRed = new MagickColor("red"); transparentRed.A = 0; using (MagickImage image = new MagickImage(Files.RedPNG)) { Test_Pixel_Equal(image, 0, 0, red); image.Transparent(red); Test_Pixel_Equal(image, 0, 0, transparentRed); Test_Pixel_NotEqual(image, image.Width - 1, 0, transparentRed); } using (MagickImage image = new MagickImage(Files.RedPNG)) { Test_Pixel_Equal(image, 0, 0, red); image.InverseTransparent(red); Test_Pixel_NotEqual(image, 0, 0, transparentRed); Test_Pixel_Equal(image, image.Width - 1, 0, transparentRed); } }
private void ExecuteInverseTransparent(XmlElement element, MagickImage image) { MagickColor color_ = Variables.GetValue<MagickColor>(element, "color"); image.InverseTransparent(color_); }
public void Test_Transparent() { MagickColor red = new MagickColor("red"); MagickColor transparentRed = new MagickColor("red"); transparentRed.A = 0; using (MagickImage image = new MagickImage(Files.RedPNG)) { ColorAssert.AreEqual(red, image, 0, 0); image.Transparent(red); ColorAssert.AreEqual(transparentRed, image, 0, 0); ColorAssert.AreNotEqual(transparentRed, image, image.Width - 1, 0); } using (MagickImage image = new MagickImage(Files.RedPNG)) { ColorAssert.AreEqual(red, image, 0, 0); image.InverseTransparent(red); ColorAssert.AreNotEqual(transparentRed, image, 0, 0); ColorAssert.AreEqual(transparentRed, image, image.Width - 1, 0); } }