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


C# IColor.GetType方法代码示例

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


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

示例1: GetNamesOfChannels

      /// <summary>
      /// Get the names of the channels
      /// </summary>
      /// <param name="color">The color</param>
      /// <returns>The names of the channels</returns>
      public static String[] GetNamesOfChannels(IColor color)
      {
         List<String> channelNames = new List<string>();
         foreach (System.Reflection.PropertyInfo pInfo in color.GetType().GetProperties())
         {
            if (pInfo.GetCustomAttributes(typeof(DisplayColorAttribute), true).Length > 0)
               channelNames.Add(pInfo.Name);
         }
         if (channelNames.Count > 0) return channelNames.ToArray();

         //Create default channel names
         String[] res = new string[color.Dimension];
         for (int i = 0; i < res.Length; i++)
            res[i] = String.Format("Channel {0}", i);
         return res;
      }
开发者ID:reidblomquist,项目名称:emgucv,代码行数:21,代码来源:ReflectColorType.cs

示例2: GetDisplayColorOfChannels

      /// <summary>
      /// Get the display color for each channel
      /// </summary>
      public static System.Drawing.Color[] GetDisplayColorOfChannels(IColor color)
      {
         List<System.Drawing.Color> channelColor = new List<System.Drawing.Color>();
         foreach (System.Reflection.PropertyInfo pInfo in color.GetType().GetProperties())
         {
            Object[] displayAtts = pInfo.GetCustomAttributes(typeof(DisplayColorAttribute), true);
            if (displayAtts.Length > 0)
               channelColor.Add(((DisplayColorAttribute)displayAtts[0]).DisplayColor);
         }
         if (channelColor.Count > 0) return channelColor.ToArray();

         //create default color
         System.Drawing.Color[] res = new System.Drawing.Color[color.Dimension];
         for (int i = 0; i < res.Length; i++)
            res[i] = System.Drawing.Color.Gray;
         return res;
      }
开发者ID:AnthonyNystrom,项目名称:Pikling,代码行数:20,代码来源:ReflectColorType.cs

示例3: GetDisplayColorOfChannels

      /// <summary>
      /// Get the display color for each channel
      /// </summary>
      /// <param name="color">The color</param>
      /// <returns>The display color for each channel</returns>
      public static Color[] GetDisplayColorOfChannels(IColor color)
      {
         List<Color> channelColor = new List<Color>();
         foreach (System.Reflection.PropertyInfo pInfo in color.GetType().GetProperties())
         {
            object[] displayAtts = pInfo.GetCustomAttributes(typeof(DisplayColorAttribute), true);
            if (displayAtts.Length > 0)
               channelColor.Add(((DisplayColorAttribute)displayAtts[0]).DisplayColor);
         }
         if (channelColor.Count > 0) return channelColor.ToArray();

         //create default color
         Color[] res = new Color[color.Dimension];
         for (int i = 0; i < res.Length; i++)
            //res[i] = Color.FromArgb(255, 125, 125, 125);
#if ( UNITY_ANDROID || UNITY_IPHONE || UNITY_STANDALONE || UNITY_METRO )
            res[i] = Color.gray;
#else
            res[i] = Color.Gray;
#endif
         return res;
      }
开发者ID:reidblomquist,项目名称:emgucv,代码行数:27,代码来源:ReflectColorType.cs

示例4: GetAction

 private static MethodInfo GetAction(IColor color, string actionName)
 {
     return color.GetType().GetMethod(actionName, BindingFlags.Public | BindingFlags.Instance);
 }
开发者ID:bbyars,项目名称:buildlight,代码行数:4,代码来源:Program.cs


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