本文整理汇总了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);
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
//}
}
示例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];
}
示例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;
}
示例14: OnCreateControl
protected override void OnCreateControl()
{
base.OnCreateControl();
this.PlaceholderColor = System.Drawing.Color.LightGray;
this.inputColor = System.Drawing.SystemColors.WindowText;
this.UpdateText(base.Focused);
}
示例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);
}
}