当前位置: 首页>>代码示例>>C#>>正文


C# Pixel.SetChannel方法代码示例

本文整理汇总了C#中Pixel.SetChannel方法的典型用法代码示例。如果您正苦于以下问题:C# Pixel.SetChannel方法的具体用法?C# Pixel.SetChannel怎么用?C# Pixel.SetChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pixel的用法示例。


在下文中一共展示了Pixel.SetChannel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test_IEquatable

    public void Test_IEquatable()
    {
      Pixel first = new Pixel(0, 0, 3);
      first.SetChannel(0, 100);
      first.SetChannel(1, 100);
      first.SetChannel(2, 100);

      Assert.IsFalse(first == null);
      Assert.IsFalse(first.Equals(null));
      Assert.IsTrue(first.Equals(first));
      Assert.IsTrue(first.Equals((object)first));

      Pixel second = new Pixel(10, 10, 3);
      second.SetChannel(0, 100);
      second.SetChannel(1, 0);
      second.SetChannel(2, 100);

      Assert.IsTrue(first != second);
      Assert.IsTrue(!first.Equals(second));
      Assert.IsTrue(!first.Equals((object)second));

      second.SetChannel(1, 100);

      Assert.IsTrue(first == second);
      Assert.IsTrue(first.Equals(second));
      Assert.IsTrue(first.Equals((object)second));
    }
开发者ID:levesque,项目名称:Magick.NET,代码行数:27,代码来源:PixelTests.cs

示例2: Test_Set_SetChannel

    public void Test_Set_SetChannel()
    {
      QuantumType half = (QuantumType)(Quantum.Max / 2.0);

      Pixel first = new Pixel(0, 0, 3);
      first.Set(new QuantumType[] { Quantum.Max, 0, half });

      Assert.AreEqual(Quantum.Max, first.GetChannel(0));
      Assert.AreEqual(0, first.GetChannel(1));
      Assert.AreEqual(half, first.GetChannel(2));

      first.SetChannel(0, 0);
      first.SetChannel(1, half);
      first.SetChannel(2, Quantum.Max);

      Assert.AreEqual(0, first.GetChannel(0));
      Assert.AreEqual(half, first.GetChannel(1));
      Assert.AreEqual(Quantum.Max, first.GetChannel(2));
    }
开发者ID:levesque,项目名称:Magick.NET,代码行数:19,代码来源:PixelTests.cs


注:本文中的Pixel.SetChannel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。