本文整理汇总了C#中System.Drawing.Color类的典型用法代码示例。如果您正苦于以下问题:C# System.Drawing.Color类的具体用法?C# System.Drawing.Color怎么用?C# System.Drawing.Color使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Drawing.Color类属于命名空间,在下文中一共展示了System.Drawing.Color类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Draw
public void Draw(int thickness, Color color)
{
DUtility.DrawLine(rekt[0].To3D(), rekt[1].To3D(), thickness, color);
DUtility.DrawLine(rekt[1].To3D(), rekt[3].To3D(), thickness, color);
DUtility.DrawLine(rekt[2].To3D(), rekt[3].To3D(), thickness, color);
DUtility.DrawLine(rekt[0].To3D(), rekt[2].To3D(), thickness, color);
}
开发者ID:AlrikSharp,项目名称:LeagueSharp-2,代码行数:7,代码来源:Rect.cs
示例17: CustomGrid_Style
/// <summary> Constructor for a new instance of the CustomGrid_Style class </summary>
/// <param name="Data_Source"> DataTable for which to atuomatically build the style for </param>
public CustomGrid_Style( DataTable Data_Source )
{
// Declare collection of columns
columns = new List<CustomGrid_ColumnStyle>();
visibleColumns = new CustomGrid_VisibleColumns( columns );
// Set some defaults
default_columnWidth = 100;
headerHeight = 23;
rowHeight = 20;
default_textAlignment = HorizontalAlignment.Center;
default_backColor = System.Drawing.Color.White;
default_foreColor = System.Drawing.Color.Black;
alternating_print_backColor = System.Drawing.Color.Honeydew;
gridLineColor = System.Drawing.Color.Black;
headerForeColor = System.Drawing.SystemColors.WindowText;
headerBackColor = System.Drawing.SystemColors.Control;
rowSelectForeColor = System.Drawing.SystemColors.WindowText;
rowSelectBackColor = System.Drawing.SystemColors.Control;
noMatchesTextColor = System.Drawing.Color.MediumBlue;
selectedColor = System.Drawing.Color.Yellow;
sortable = true;
column_resizable = true;
primaryKey = -1;
double_click_delay = 1000;
// Set this data source
this.Data_Source = Data_Source;
}
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:31,代码来源:CustomGrid_Style.cs
示例18: Effect_Text
//#----------------------------------------------------------
//# * Initialize
//#----------------------------------------------------------
public Effect_Text(string text, Color color, int x, int y, int maxTick)
: base(maxTick)
{
_text = text;
_color = color;
_startPt = new Point2DEx(x, y);
}
开发者ID:LRih,项目名称:Tetrix-Battle,代码行数:10,代码来源:Effect_Text.cs
示例19: ShiftColor
public static Color ShiftColor(Color c, int shiftAmount)
{
int newRed = c.R;
int newGreen = c.G;
int newBlue = c.B;
// Red to purple
if (c.R == 255 && c.B < 255 && c.G == 0)
newBlue = newBlue + shiftAmount;
// Purple to blue
else if (c.B == 255 && c.R > 0)
newRed = newRed - shiftAmount;
// Blue to light-blue
else if (c.B == 255 && c.G < 255)
newGreen = newGreen + shiftAmount;
// Light-blue to green
else if (c.G == 255 && c.B > 0)
newBlue = newBlue - shiftAmount;
// Green to yellow
else if (c.G == 255 && c.R < 255)
newRed = newRed + shiftAmount;
// Yellow to red
else if (c.R == 255 && c.G > 0)
newGreen = newGreen - shiftAmount;
newRed = BringIntInColorRange(newRed);
newGreen = BringIntInColorRange(newGreen);
newBlue = BringIntInColorRange(newBlue);
return Color.FromArgb(c.A, newRed, newGreen, newBlue);
}
开发者ID:SpoinkyNL,项目名称:Artemis,代码行数:31,代码来源:ColorHelpers.cs
示例20: DrawCricleMinimap
public static void DrawCricleMinimap(Vector2 screenPosition, float radius, Color color, float width = 2F, int quality = -1)
{
if (quality == -1)
{
quality = (int) (radius / 3 + 15);
}
var rad = new Vector2(0, radius);
var segments = new List<MinimapCircleSegment>();
var full = true;
for (var i = 0; i <= quality; i++)
{
var pos = (screenPosition + rad).RotateAroundPoint(screenPosition, PI2 * i / quality);
var contains = MinimapRectangle.Contains(pos);
if (!contains)
{
full = false;
}
segments.Add(new MinimapCircleSegment(pos, contains));
}
foreach (var ar in FindArcs(segments, full))
{
Line.DrawLine(color, width, ar);
}
}
开发者ID:giaanthunder,项目名称:EloBuddy,代码行数:26,代码来源:Utilities.cs
注:本文中的System.Drawing.Color类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论