Setting CustomColors in a ColorDialog

前端 未结 3 1267
花落未央
花落未央 2021-02-19 17:48

Custom color set in the color dialog are supposed to be set to {Blue, Blue} using the following code:

colorDialog1.CustomColors = new int[] { System.Drawing.Colo         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-02-19 18:13

    If you use ColorTranslator FromArgb, you can keep RGB colors in their proper order. For example, ColorTranslator.ToOle(Color.FromArgb(255, 0, 0)), is red. You can also use this to set colors that don't have a name, for example, the bright red ColorTranslator.ToOle(Color.FromArgb(255, 31, 33)),.

提交回复
热议问题