Questions tagged «system.drawing.color»

6
将System.Drawing.Color转换为RGB和十六进制值
我正在使用C#尝试开发以下两个。我的操作方式可能会有问题,需要您的友善建议。另外,我不知道是否有任何现有方法可以做到这一点。 private static String HexConverter(System.Drawing.Color c) { String rtn = String.Empty; try { rtn = "#" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2"); } catch (Exception ex) { //doing nothing } return rtn; } private static String RGBConverter(System.Drawing.Color c) { String rtn = String.Empty; try { rtn = "RGB(" + c.R.ToString() …


6
设置System.Drawing.Color值
您好如何在中设置R G B值System.Drawing.Color.G? 这是System.Drawing.Color.G=255;不允许的,因为它是只读的 Property or indexer 'System.Drawing.Color.G' cannot be assigned toit is read only 我只需要Color通过分配自定义R G B值来创建对象
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.