TextOut(100,50,strText);strText.Format(_T("R分量:0x%02X"),RED);pDC->TextOut(100,100,strText);strText.Format(_T("G分量:0x%02X"),GREEN);pDC->TextOut(100,150,strText);strText.Format(_T("B分量:0x%02X"),BLUE);pDC->TextOut(100,200,strText);-IMDN开发者社群-imdn.cn">
TextOut(100,50,strText);strText.Format(_T("R分量:0x%02X"),RED);pDC->TextOut(100,100,strText);strText.Format(_T("G分量:0x%02X"),GREEN);pDC->TextOut(100,150,strText);strText.Format(_T("B分量:0x%02X"),BLUE);pDC->TextOut(100,200,strText); - IMDN开发者社群-imdn.cn">
首页 »
其他 »
VC++转换COLORREF值为RGB分量
于 2022-06-13 发布
文件大小:202.20 kB
0 233
VC++转换COLORREF值为RGB分量,举个例子,在本例中,是将COLORREF值:0x000080FF转换成:R分量:0xFF、G分量:0x80、B分量:0x00,注意,并不是分离。请看定义:
//R分量
BYTE RED = GetRValue(cr);
//G分量
BYTE GREEN = GetGValue(cr);
//B分量
BYTE BLUE = GetBValue(cr);
CString strText = _T("");
strText.Format(_T("COLORREF值:0x%08X"), cr);
pDC->TextOut(100, 50, strText);
strText.Format(_T("R分量:0x%02X"), RED);
pDC->TextOut(100, 100, strText);
strText.Format(_T("G分量:0x%02X"), GREEN);
pDC->TextOut(100, 150, strText);
strText.Format(_T("B分量:0x%02X"), BLUE);
pDC->TextOut(100, 200, strText);
下载说明:请别用迅雷下载,失败请重下,重下不扣分!
lan see a tool for intranet
lan see a tool for intranet
2023-07-21 14:05:05下载
积分:1
标志东华
logo donghua
2022-11-06 14:55:03下载
积分:1
读写INI
读写INI-literacy INI .................................
2022-02-05 18:14:37下载
积分:1
使用一排列对象接受类型int、浮点和串的实体类型3 attibutes 展示对constructor的用途。...
使用一排列对象接受类型int、浮点和串的实体类型3 attibutes 展示对constructor的用途。-A program that uses an array of objects that receives 3 attibutes of an entity type of type int, float and string demonstrates use of constructors.
2022-07-26 12:41:32下载
积分:1
m序列的生成器,rake接受,简单易用,希望对大家有帮助
m序列的生成器,rake接受,简单易用,希望对大家有帮助-m sequence generator, rake acceptable, easy to use, everybody would like to have help. . .
2022-04-08 22:38:08下载
积分:1
一个非常流行的游戏,用C++开发的,适用于初学者学习与研究。...
一个非常流行的游戏,用C++开发的,适用于初学者学习与研究。-a very popular game, with C development and applicable to beginners learning and research.
2023-05-25 17:15:03下载
积分:1
PCF8563的中文技术资料,不知道具体的上传,添加其 他 …
pcf8563的中文技术资料,不知道具体上载到哪儿,因此放入其他类中,希望对大家有所帮助!-pcf8563 Chinese technical data and do not know where specific uploading, Add other category, We want to help!
2022-03-11 17:09:38下载
积分:1
简单潜艇大战是一个很有意思的游戏,简单好玩。
简单潜艇大战是一个很有意思的游戏,简单好玩。-Simple World War II submarine is a very interesting game, simple fun.
2022-08-06 10:59:27下载
积分:1
通讯录的源程序,大家可以看看啊,提点建议吧。
通讯录的源程序,大家可以看看啊,提点建议吧。-directory of the source, we can see ah, how it proposed.
2022-01-27 22:50:02下载
积分:1
一个简单的VC++异常处理例子
一个简单的VC++异常处理例子,通过对选项框的内异常操作,来演示VC++是如何进行处理异常的,对编写出运行完美的VC++程序至关重要。
2022-03-24 19:53:40下载
积分:1