本文整理汇总了C#中ColorPicker类的典型用法代码示例。如果您正苦于以下问题:C# ColorPicker类的具体用法?C# ColorPicker怎么用?C# ColorPicker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColorPicker类属于命名空间,在下文中一共展示了ColorPicker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpellDrawer
public SpellDrawer(Menu mainMenu)
{
Drawing.OnDraw += Drawing_OnDraw;
Menu = mainMenu;
DangerColorPickers = new ColorPicker[4];
Game_OnGameLoad();
}
示例2: MainForm
public MainForm()
{
InitializeComponent();
ColorPicker picker = new ColorPicker("Auto");
picker.ShowDialog();
button1.Text = picker.ColorIndex + "";
}
示例3: ShowEdit
/// <summary>
/// Show the color category editor form.
/// </summary>
/// <param name="e"></param>
public void ShowEdit(IColorCategory e)
{
using (var frm = new ColorPicker(e))
{
ShowDialog(frm);
}
}
示例4: EditValue
/// <summary>
/// Edits the given object value using the editor style provided by the <see cref="M:System.Drawing.Design.ColorEditor.GetEditStyle(System.ComponentModel.ITypeDescriptorContext)"></see> method</summary>
/// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that can be used to gain additional context information</param>
/// <param name="provider">An <see cref="T:System.IServiceProvider"></see> through which editing services may be obtained</param>
/// <param name="value">An instance of the value being edited</param>
/// <returns>The new value of the object. If the value of the object has not changed, this should return the same object it was passed.</returns>
public override object EditValue(
ITypeDescriptorContext context,
IServiceProvider provider,
object value)
{
IWindowsFormsEditorService editorService =
provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
if (editorService != null)
{
ColorPicker picker = new ColorPicker((Color)value, m_enableAlpha);
// skin service, skins this control
// when it shown so it override the labels
// used for primary and seconadary color.
// When it shown we need to reset the color property.
Color color = (Color)value;
picker.Shown += (sender, e) =>
{
var colorpicker = (ColorPicker)sender;
colorpicker.SetStartColor(color, m_enableAlpha);
};
if (DialogResult.OK == editorService.ShowDialog(picker))
value = picker.PrimaryColor;
}
return value;
}
示例5: basic_colorpicker_render
public void basic_colorpicker_render()
{
var html = new ColorPicker("foo").ToString();
html.ShouldHaveHtmlNode("foo")
.ShouldBeNamed(HtmlTag.Input)
.ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Color);
}
示例6: It_Should_Be_Possible_To_Add_Multiple_ColorPickers
public void It_Should_Be_Possible_To_Add_Multiple_ColorPickers()
{
var first = new ColorPicker("MyColorPicker1");
var second = new ColorPicker("MyColorPicker2");
var third = new ColorPicker("MyColorPicker3");
_sut.With(() => first).With(() => second).With(() => third);
Assert.AreEqual(3, _sut._colorPickers.Count);
}
示例7: GetColorPicker_Should_Find_And_Return_Correct_ColorPicker
public void GetColorPicker_Should_Find_And_Return_Correct_ColorPicker()
{
var actual = new ColorPicker("MyColorPicker");
var fake = new ColorPicker("MyMenuSection.MyColorPicker");
_sut._colorPickers.Add(actual);
_sut._colorPickers.Add(fake);
Assert.AreEqual(actual,_sut.GetColorPicker("MyColorPicker"));
}
示例8: ColorPickerViewModel
public ColorPickerViewModel(ColorPicker view)
{
_view = view;
HueSpan = 36;
SaturationSpan = 10;
Brightness = 1;
}
示例9: ThemeSettings
public ThemeSettings(bool isGlobal)
{
InitializeComponent();
this.cPicker = new ColorPicker();
this.cPicker.Hide();
this.cPicker.setColorPreview += new setColorHandler(setColorPreview);
this.cPicker.getColor += new getColorHandler(getColor);
global = isGlobal;
}
示例10: ColorPanel_Click
private void ColorPanel_Click(object sender, EventArgs e)
{
using (ColorPicker picker = new ColorPicker()) {
picker.Color = XYZ.FromRGB(Color);
if (picker.ShowDialog() == DialogResult.OK) {
Color = picker.Color.ToRGB();
}
}
}
示例11: ColorComboBox
/// <summary>
/// ComboBox that display systema and web colors.
/// </summary>
public ColorComboBox()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// Subscibe to ColorPicker's events
cp = new ColorPicker();
cp.ColorChanged += new EventHandler(ColorPicker_ColorChanged);
cp.Deactivate += new EventHandler(ColorPicker_Deactivate);
}
示例12: ColorPickerPopup
public ColorPickerPopup(ColorPicker cp)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
lStatus.Text = "";
_ColorPicker = cp;
}
示例13: Start
// Use this for initialization
void Start ()
{
_content = GameObject.Find ("MaterialsContent");
_materialsDict = new Dictionary<int, GameObject> ();
_selectedMaterials = new List<int> ();
_materialColors = new Dictionary<int, Color> ();
_colorPicker = GameObject.Find ("ColorPicker").GetComponent<ColorPicker> ();
_demo = GameObject.Find ("DemoObject").GetComponent<Demo> ();
Invoke("OnNewMaterial", 0.5f);
}
示例14: bInsertColor_Click
private void bInsertColor_Click( object sender, EventArgs e ) {
if( colorPicker == null ) colorPicker = new ColorPicker("Insert color",0);
if( colorPicker.ShowDialog() == DialogResult.OK){
string colorToInsert = MainForm.Parse( colorPicker.ColorIndex );
int selectionStart = tText.SelectionStart;
tText.Paste( colorToInsert );
tText.Select( selectionStart, 2 );
tText.Focus();
}
}
示例15: panelColor_Click
private void panelColor_Click(object sender, EventArgs e)
{
using (ColorPicker cp = new ColorPicker()) {
cp.Color = XYZ.FromRGB(panelColor.BackColor);
DialogResult result = cp.ShowDialog();
if (result == DialogResult.OK) {
panelColor.BackColor = cp.Color.ToRGB().ToArgb();
}
}
}