⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_48311.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:48311 发表者:草叶 发表日期:2003-07-30 10:25:27
<br>主题:怎样得到颜色值(colorref类型)的红、黄、蓝色的分别的值?
<br>内容:怎样得到颜色值(colorref类型)的红、黄、蓝色的分别的值?<BR>比如,使用ccolordialog对话框得到的颜色m_getcolor(COLORREF类型)的值是RGB(x、y、z),怎样分别获得x、y、z的值?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:风之文章 回复日期:2003-07-30 10:45:32
<br>内容:CColorDialog dlg;<BR>if (dlg.DoModal() == IDOK)<BR>{<BR>&nbsp;&nbsp; COLORREF color = dlg.GetColor();<BR>&nbsp;&nbsp; TRACE("RGB value of the selected color - red = %u, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;green = %u, blue = %u\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetRValue(color), GetGValue(color), GetBValue(color));<BR>}<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:草叶 回复日期:2003-07-30 16:56:11
<br>内容:得到的是int类型还是uint型
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:金枪鱼 回复日期:2003-07-30 17:00:13
<br>内容:MSDN 说,<BR>Platform SDK: Windows GDI <BR><BR>GetRValue<BR><BR>The GetRValue macro retrieves an intensity value for the red component of a red, green, blue (RGB) value. <BR><BR>BYTE GetRValue(<BR>&nbsp;&nbsp;DWORD rgb&nbsp;&nbsp;// RGB value<BR>);<BR>Parameters<BR>rgb <BR>Specifies an RGB color value. <BR>Return Values<BR>The return value is the intensity of the red component of the specified RGB color. <BR><BR>Remarks<BR>The intensity value is in the range 0 through 255. <BR><BR>也就是说返回的值是BYTE类型(无符号字符),转换成整数值在0~255之间。<BR>2003-7-30 17:05:11

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -