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分量

VC++转换COLORREF值为RGB分量

于 2022-06-13 发布 文件大小:202.20 kB
0 159
下载积分: 2 下载次数: 1

代码说明:

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);

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 人脸识别相关的英文论文,希望对你有帮助
    人脸识别相关的英文论文,希望对你有帮助-Face Recognition related English papers, I hope you have help
    2022-11-04 01:15:04下载
    积分:1
  • 双向DC_DC变换器
    应用背景设计并制作了一个用于电池储能装置的双向 DC-DC 变换器,实现电池的充放电功能,功能可由 按键设定,亦可自动转换。 关键技术 作品设计了一个电池储能的双向DC-DC变换器。该系统以STM32F103ZET6单片机作为控制核心,其输出PWM信号通过6N137光耦隔离,IR2110驱动功率MOS,采用LM358做电压跟随,INA282采集电流,通过ADS1115采集到单片机以实现负反馈控制。用TFT-LCD进行显示操作界面及相应参数,加上PID算法,能够实现软件上的过冲保护,及稳定充电电流。GUI界面的应用,使得人机交互更为友好、整体操作更为智能、简洁。通过测试,该系统能够实现在1-2A范围内以0.01A的步进值进行调整,其精度高于5%。充电模式效率达95%,放电效率达96%以上。
    2023-01-02 16:35:05下载
    积分:1
  • 这是一个简单的网站的HTML
    it is a simple website in html
    2022-08-11 02:10:54下载
    积分:1
  • 硬件 部 分 ,我们建立了以ARM处理器为核心的开发板,通过CMOs摄 像头实时采集图像信息并通过液晶显示器显示。操作系统部分实现了实 时嵌入式操作系统...
    硬件 部 分 ,我们建立了以ARM处理器为核心的开发板,通过CMOs摄 像头实时采集图像信息并通过液晶显示器显示。操作系统部分实现了实 时嵌入式操作系统的开发和移植,并在系统上扩展了文件系统模块,使 之支持图像信息的存储和更为广泛的应用开发。图像算法部分实现了图 像采集、BMP编码、图像存储,以及对所生成的数字图像进行数字处理 等功能。-Hardware part, we set up the ARM processor as the core to the development board, through the CMOs camera images in real-time information collected through the liquid crystal display. Part of the operating system implementation of real-time embedded operating system development and transplantation, and expanded on in the system file system modules, to support the image information storage and a wider range of application development. Part of the image algorithm implementation of the image acquisition, BMP coding, image storage, and digital images generated by digital processing functions.
    2022-09-15 12:10:04下载
    积分:1
  • remote retail billing system
    remote retail billing system
    2023-04-24 23:05:04下载
    积分:1
  • 按键检测,有四个按键与四个八段数码管对应,按不同的键相应的数码管显示...
    按键检测,有四个按键与四个八段数码管对应,按不同的键相应的数码管显示-Key test, there are four buttons with four eight out of the digital control counterparts, according to different keys corresponding digital tube display
    2022-03-21 03:13:32下载
    积分:1
  • 最优路径 深度优先搜索
    最优路径 深度优先搜索-optimal path depth-first search
    2023-01-04 17:05:03下载
    积分:1
  • SOM算法写的java
    用Java写的SOM,采用eclipse开发环境-SOM algorithm writing in Java
    2023-04-27 10:40:03下载
    积分:1
  • cs5522厂家源开发集成块驱动代码文档,该文档已汉化,对学习电子称AD转换的有一定的好处。...
    cs5522厂家源开发集成块驱动代码文档,该文档已汉化,对学习电子称AD转换的有一定的好处。-cs5522 driver chip manufacturers to develop the source code files, the document has finished, the study said AD conversion of the electron must have benefits.
    2022-08-05 20:20:33下载
    积分:1
  • VC 6.0 programming examples, including a small number of classic games, we hope...
    VC++6.0示例编程,包括了几个经典的小游戏,希望大家多多指教-VC 6.0 programming examples, including a small number of classic games, we hope the exhibitions
    2022-08-13 12:23:47下载
    积分:1
  • 696516资源总数
  • 106409会员总数
  • 8今日下载