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


C# ColorPicker类代码示例

本文整理汇总了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();
 }
开发者ID:giaanthunder,项目名称:EloBuddy,代码行数:7,代码来源:SpellDrawer.cs

示例2: MainForm

 public MainForm()
 {
     InitializeComponent();
     ColorPicker picker = new ColorPicker("Auto");
     picker.ShowDialog();
     button1.Text = picker.ColorIndex + "";
 }
开发者ID:mbl111,项目名称:Ava,代码行数:7,代码来源:MainForm.cs

示例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);
     }
 }
开发者ID:hanchao,项目名称:DotSpatial,代码行数:11,代码来源:ColorCategoryActions.cs

示例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;
        }
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:33,代码来源:ColorPickerEditor.cs

示例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);
 }
开发者ID:atomicobject,项目名称:mvccontrib,代码行数:7,代码来源:ColorPickerTests.cs

示例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);
 }
开发者ID:ThorstenHans,项目名称:FluentSPRibbon,代码行数:8,代码来源:MenuSection_Tests.cs

示例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"));
 }
开发者ID:ThorstenHans,项目名称:FluentSPRibbon,代码行数:8,代码来源:MenuSection_Tests.cs

示例8: ColorPickerViewModel

        public ColorPickerViewModel(ColorPicker view)
        {
            _view = view;

            HueSpan = 36;
            SaturationSpan = 10;
            Brightness = 1;
        }
开发者ID:kienaiProject,项目名称:ArtOfWords,代码行数:8,代码来源:ColorPickerViewModel.cs

示例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;
 }
开发者ID:bchalls,项目名称:StickyNotes,代码行数:9,代码来源:ThemeSettings.cs

示例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();
				}
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:9,代码来源:ColorPanel.cs

示例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);
        }
开发者ID:abhishek-kumar,项目名称:AIGA,代码行数:13,代码来源:ColorComboBox.cs

示例12: ColorPickerPopup

        public ColorPickerPopup(ColorPicker cp)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            lStatus.Text = "";
            _ColorPicker = cp;
        }
开发者ID:bittercoder,项目名称:odd-reports,代码行数:10,代码来源:ColorPickerPopup.cs

示例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);
	}
开发者ID:whztt07,项目名称:PolyWorldEditor,代码行数:11,代码来源:MaterialsController.cs

示例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();
     }
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:TextEditorPopup.cs

示例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();
				}
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:10,代码来源:ColorBreakdownItemControl.cs


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