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


C# Drawing.Color类代码示例

本文整理汇总了C#中System.Drawing.Color的典型用法代码示例。如果您正苦于以下问题:C# System.Drawing.Color类的具体用法?C# System.Drawing.Color怎么用?C# System.Drawing.Color使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


System.Drawing.Color类属于命名空间,在下文中一共展示了System.Drawing.Color类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawCircleOnMinimap

        public static void DrawCircleOnMinimap(
            Vector3 center,
            float radius,
            Color color,
            int thickness = 1,
            int quality = 254)
        {
            var pointList = new List<Vector3>();
            for (var i = 0; i < quality; i++)
            {
                var angle = i * Math.PI * 2 / quality;
                pointList.Add(
                    new Vector3(
                        center.X + radius * (float)Math.Cos(angle), center.Y + radius * (float)Math.Sin(angle),
                        center.Z));
            }

            for (var i = 0; i < pointList.Count; i++)
            {
                var a = pointList[i];
                var b = pointList[i == pointList.Count - 1 ? 0 : i + 1];

                var aonScreen = Drawing.WorldToMinimap(a);
                var bonScreen = Drawing.WorldToMinimap(b);

                Drawing.DrawLine(aonScreen.X, aonScreen.Y, bonScreen.X, bonScreen.Y, thickness, color);
            }
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:28,代码来源:Geometry.cs

示例2: FioraPassive

        public FioraPassive(Obj_GeneralParticleEmitter emitter, AIHeroClient enemy)
            : base(emitter.Index, (uint)emitter.NetworkId, emitter as GameObject)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                Passive = PassiveType.UltPassive;
                Color = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                Passive = PassiveType.PassiveTimeout;
                Color = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color = Color.Green;
            }
            PassiveDistance = Passive == PassiveType.UltPassive ? 400 : 200;
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:27,代码来源:PassiveManager.cs

示例3: drawLine

        public static void drawLine(Vector3 pos1, Vector3 pos2, int bold, Color color)
        {
            var wts1 = Drawing.WorldToScreen(pos1);
            var wts2 = Drawing.WorldToScreen(pos2);

            Drawing.DrawLine(wts1[0], wts1[1], wts2[0], wts2[1], bold, color);
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:7,代码来源:Program.cs

示例4: BindSelectedColor

 public void BindSelectedColor(Color color)
 {
     BindColorToStyle(color);
     BindColorToVariant(color);
     if (View.IsDisplayDefaultPicture())
     {
         View.EnableUpdatingPreviewImages();
         UpdatePreviewImages(
             View.CreateDefaultPictureItem(),
             PowerPointCurrentPresentationInfo.CurrentSlide.GetNativeSlide(),
             PowerPointPresentation.Current.SlideWidth,
             PowerPointPresentation.Current.SlideHeight);
         View.DisableUpdatingPreviewImages();
         BindStyleToColorPanel();
     }
     else
     {
         UpdatePreviewImages(
             ImageSelectionListSelectedItem.ImageItem ??
             View.CreateDefaultPictureItem(),
             PowerPointCurrentPresentationInfo.CurrentSlide.GetNativeSlide(),
             PowerPointPresentation.Current.SlideWidth,
             PowerPointPresentation.Current.SlideHeight);
     }
 }
开发者ID:oswellchan,项目名称:PowerPointLabs,代码行数:25,代码来源:PictureSlidesLabWindowViewModel.VariationStageControls.cs

示例5: DrawText

 public static void DrawText(float x, float y, Color c, string text)
 {
     if (text != null)
     {
         Drawing.DrawText(x, y, c, text);
     }
 }
开发者ID:654955321,项目名称:HY_Recommend,代码行数:7,代码来源:TextUtils.cs

示例6: FioraPassive

        public FioraPassive(Obj_GeneralParticleEmitter emitter, Obj_AI_Hero enemy)
            : base((ushort) emitter.Index, (uint) emitter.NetworkId)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                //PassiveManager.PassiveList.RemoveAll(
                //    p => p.Target.Equals(Target) && !p.Type.Equals(PassiveType.UltPassive));
                Passive = PassiveType.UltPassive;
                Color = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                PassiveManager.PassiveList.RemoveAll(p => p.Target.Equals(Target) && p.Type.Equals(PassiveType.Passive));
                Passive = PassiveType.PassiveTimeout;
                Color = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color = Color.Green;
            }
            //Console.WriteLine("[PASSIVE] Type: {0} Target: {2} Name: {1}", Passive, Name, Target.Name);
            PassiveDistance = Passive.Equals(PassiveType.UltPassive) ? 320 : 200;
        }
开发者ID:EgoSharp,项目名称:LeagueSharp,代码行数:31,代码来源:PassiveManager.cs

示例7: CharAttribs

 public CharAttribs( 
     System.Boolean       p1,
     System.Boolean       p2,
     System.Boolean       p3,
     System.Boolean       p4,
     System.Boolean       p5,
     System.Boolean       p6,
     System.Boolean       p7,
     System.Boolean       p12,
     System.Drawing.Color p13,
     System.Boolean       p14,
     System.Drawing.Color p15,
     uc_Chars             p16,
     uc_Chars             p17,
     uc_Chars             p18,
     System.Boolean       p19)
 {
     //prntSome.printSome("CharAttribs");
     IsBold          = p1;
     IsDim           = p2;
     IsUnderscored   = p3;
     IsBlinking      = p4;
     IsInverse       = p5;
     IsPrimaryFont   = p6;
     IsAlternateFont = p7;
     UseAltColor     = p12;
     AltColor        = p13;
     UseAltBGColor   = p14;
     AltBGColor      = p15;
     GL              = p16;
     GR              = p17;
     GS              = p18;
     IsDECSG         = p19;
 }
开发者ID:ArsenShnurkov,项目名称:AckTerm,代码行数:34,代码来源:ackterm.drawing.cs

示例8: LoadSettings

        private void LoadSettings()
        {
            try
            {
                // Try to load saved settings
                //  Common.Configuration.AppConfig.Reload();

                _VisualFeedbackColor = AppConfig.VisualFeedbackColor;
                VisualFeedbackWidthSlider.Value = AppConfig.VisualFeedbackWidth;
                MinimumPointDistanceSlider.Value = AppConfig.MinimumPointDistance;
                chkWindowsStartup.IsChecked = GetStartupStatus();
                OpacitySlider.Value = AppConfig.Opacity;
                chkOrderByLocation.IsChecked = AppConfig.IsOrderByLocation;
                ShowBalloonTipSwitch.IsChecked = AppConfig.ShowBalloonTip;
                ShowTrayIconSwitch.IsChecked = AppConfig.ShowTrayIcon;
                SendLogToggleSwitch.IsChecked = AppConfig.SendErrorReport;

                LanguageComboBox.ItemsSource = LocalizationProvider.Instance.GetLanguageList("ControlPanel");
                LanguageComboBox.SelectedValue = AppConfig.CultureName;

                TimeoutTextBox.Text = AppConfig.GestureTimeout.ToString();
            }
            catch (Exception)
            {
                MessageBox.Show(LocalizationProvider.Instance.GetTextValue("Options.Messages.LoadSettingError"),
                    LocalizationProvider.Instance.GetTextValue("Options.Messages.LoadSettingErrorTitle"), MessageBoxButton.OK,
                    MessageBoxImage.Error);
            }
        }
开发者ID:YashMaster,项目名称:GestureSign,代码行数:29,代码来源:Options.cs

示例9: User

		public User(string id, string name, int color, long tick) {
			Id = id;
			Name = name;
			Color = System.Drawing.Color.FromArgb(color);
			LastCommentDate = new DateTime(tick);
			State = UserState.None;
		}
开发者ID:nico-lab,项目名称:niconama-ocv,代码行数:7,代码来源:User.cs

示例10: MessColor

 public MessColor(int id,string keyMess,System.Drawing.Color forecolor,System.Drawing.Color backColor)
 {
     this.id = id;
     this.keyMess = keyMess;
     this.forecolor = forecolor;
     this.backColor = backColor;
 }
开发者ID:ufjl0683,项目名称:Center,代码行数:7,代码来源:MessColor.cs

示例11: DrawCircle

        public static void DrawCircle(Vector3 center,
            float radius,
            Color color,
            int thickness = 5,
            int quality = 60)
        {
            Render.Circle.DrawCircle(center, radius, color, thickness, false);

            //var pointList = new List<Vector3>();
            //for (var i = 0; i < quality; i++)
            //{
            //    var angle = i * Math.PI * 2 / quality;
            //    pointList.Add(
            //        new Vector3(
            //            center.X + radius * (float)Math.Cos(angle), center.Y + radius * (float)Math.Sin(angle),
            //            center.Z));
            //}

            //for (var i = 0; i < pointList.Count; i++)
            //{
            //    var a = pointList[i];
            //    var b = pointList[i == pointList.Count - 1 ? 0 : i + 1];

            //    var aonScreen = Drawing.WorldToScreen(a);
            //    var bonScreen = Drawing.WorldToScreen(b);

            //    Drawing.DrawLine(aonScreen.X, aonScreen.Y, bonScreen.X, bonScreen.Y, thickness, color);
            //}
        }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:29,代码来源:HINH1.cs

示例12: SelectColor

        public void SelectColor(string idColor)
        {
            colors = new List<System.Drawing.Color>();
            colors.Add(System.Drawing.Color.White);
            colors.Add(System.Drawing.Color.Orange);
            colors.Add(System.Drawing.Color.Blue);
            colors.Add(System.Drawing.Color.Red);
            colors.Add(System.Drawing.Color.Yellow);


            switch (idColor)
            {
                case "up":
                    if (currentcolor < colors.Count-1)
                        currentcolor++;
                    break;

                case "down":
                    if (currentcolor>0)
                        currentcolor--;
                    break;
                                  
            }


            colorLight=colors[currentcolor];
        }
开发者ID:Maksimus95,项目名称:WebSmartHouse,代码行数:27,代码来源:Lamp.cs

示例13: ToHtml

 /// <summary>
 /// 将文字转换为Html输出格式
 /// </summary>
 /// <param name="form">要输出的内容</param>
 /// <param name="FontName">字体名</param>
 /// <param name="FontSize">字体大小</param>
 /// <param name="FontColor">字体颜色</param>
 /// <returns>格式化后的内容</returns>
 public static string ToHtml(this string form, string FontName, int FontSize, Color FontColor)
 {
     string colorhx = "#" + FontColor.ToArgb().ToString("X6");
     form = form.ToUTF8();
     form = $"<font face=\"{FontName}\" size=\"{FontSize}\"  color=\"{colorhx}\">{form}</font>";
     return form;
 }
开发者ID:VivianGit,项目名称:LeagueSharp,代码行数:15,代码来源:TextExtensions.cs

示例14: OnCreateControl

 protected override void OnCreateControl()
 {
     base.OnCreateControl();
     this.PlaceholderColor = System.Drawing.Color.LightGray;
     this.inputColor = System.Drawing.SystemColors.WindowText;
     this.UpdateText(base.Focused);
 }
开发者ID:lscyane,项目名称:KCBr,代码行数:7,代码来源:PlaceholdTextBox.cs

示例15: RaiseMessage

 void RaiseMessage(string message, Color color, bool asChild = false, bool emphasis = false, bool embed = false)
 {
     if (OnMessage != null)
     {
         OnMessage(message, asChild, emphasis, embed, color);
     }
 }
开发者ID:kainhong,项目名称:Babylon.js,代码行数:7,代码来源:BabylonExporter.cs


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