开发者

assign bytes to RGB Color

I tried to assign byte to RGB color but I got this error in VS2010 "Property or indexer 'System.Drawing.Color.R' cannot be assigned to -- it is 开发者_如何转开发read only" so how can I assign byte to RGB color ?


There is no way to assign this property. Instead you should create new Color instance:

Color oldColor;
byte r;
Color newColor = Color.FromArgb(oldColor.A, r, oldColor.G, oldColor.B);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜