阅读:1845回复:4
各位大侠,怎样将IColor的颜色转化成System.Drawing.Color
各位大侠,怎样将IColor的颜色转化成System.Drawing.Color
|
|
1楼#
发布于:2005-11-07 09:22
<P>不能通过RGB来传递吗?试试看!</P>
|
|
2楼#
发布于:2005-11-07 09:35
<P><STRONG><FONT face=Verdana color=#61b713>cftao2008,能不能具体点啊,</FONT></STRONG></P>
<P><STRONG><FONT face=Verdana color=#61b713>我用 </FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>IColor = color;</FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>System.Drawing.Color co</FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>int rgb = color.RGB;</FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>co = Color.FromArgb(rgb);</FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>button1.BackColor = co;</FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>但显示出来的结果不对.</FONT></STRONG></P><img src="images/post/smile/dvbbs/em02.gif" /> |
|
3楼#
发布于:2005-11-07 13:38
<P>你这用的是哪个语言啊?我怎么就看不懂呢?能不能写成VB或C!我感觉这些变量里面没什么关系!</P>
|
|
4楼#
发布于:2005-11-07 13:52
<P>这是一段伪代码:</P>
<P>dim pColor as IColor</P> <P>set pColor = new RGBColor</P> <P>set pSysColor as <STRONG><FONT face=Verdana color=#61b713>System.Drawing.Color </FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>pColor.RGB = RGB(0,0,0) 为Icolor对象赋值</FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>pSysColor.RGB = pColor.RGB 将IColor对象的值赋给System.Drawing.Color </FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713></FONT></STRONG> </P> |
|