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 142
下载积分: 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 个回复

  • C# GDI+绘图实例源码
    C# GDI+绘图实例源码,演示如何实现基本的GDI+绘图操作以及处理窗体显示事件,内含两个GDIDrawing绘图例子,可画直线、简单的几何图形等,如示例截图所示,比较基础的GDI+绘图实例。
    2022-03-21 22:21:52下载
    积分:1
  • 在Labview编程环境中,字符串与簇之间的转换的例子。
    在Labview编程环境中,字符串与簇之间的转换的例子。-In the Labview programming environment, the string with the conversion between cluster examples.
    2022-02-13 07:21:15下载
    积分:1
  • Language programming of 100 cases
    c语言编程100例,介绍了一些问题的编程-Language programming of 100 cases
    2022-02-06 22:03:43下载
    积分:1
  • LCD design resource reference for the inquiry PANEL resources
    LCD设计资源参考,用于查询PANEL资源-LCD design resource reference for the inquiry PANEL resources
    2023-04-07 07:30:04下载
    积分:1
  • 神龙卡播放MP4源代码,采用DSHOW开发技术
    神龙卡播放MP4源代码,采用DSHOW开发技术-SHENLONG card MP4 player source code, using dshow Development Technology
    2022-10-19 17:25:03下载
    积分:1
  • a collection of M
    a collection of M-files to study concepts in the following areas of Fuzzy-Set-Theory: Fuzzy or Multivalued Logic, The Calculus of Fuzzy, Quantities, Approximate Reasoning, Possibility Theory, Fuzzy Control, Neuro-Fuzzy Systems.
    2022-09-25 18:30:03下载
    积分:1
  • 涡轮增压的PASCLR 7开发工具
    TURBO PASCLR 7.0 的开发工具-TURBO PASCLR 7.0 Development Tools
    2022-04-12 14:36:38下载
    积分:1
  • 模拟可变存储管理部一,设计成为一句很好的诗…
    模拟实现可变分区存储管理 一、设计目的 在熟练掌握计算机分区存储管理方式的原理的基础上,利用C程序设计语言在windows操作系统下模拟实现操作系统的可变分区存储管理的功能,一方面加深对原理的理解,另一方面提高根据已有原理通过编程解决实际问题的能力,为进行系统软件开发和针对实际问题提出高效的软件解决方案打下基础。 二、各功能模块分析实现 设计合理的数据结构来描述存储空间: 对于未分配出去的部分,用空闲分区链表来描述。-simulation variable Storage Management Division I. designed to become well versed in computer storage area management approaches on the basis of principle, C programming language in the windows operating system simulation systems of variable storage area management function, on the one hand, to deepen their understanding of the principles, Under the enhanced program has been through the principle of solving practical problems. for systems software development and puts forward a highly-efficient software solutions lay the groundwork. 2, the functional analysis module designed to achieve reasonable data structure to describe the storage space : Unallocated out of the question, use idle Linklist to describe.
    2023-06-05 11:05:03下载
    积分:1
  • 优化大师,c#, 优化大师,c#,
    优化大师,c#, 优化大师,c#, -优化大师,c#,优化大师,c#,优化大师,c#,优化大师,c#,
    2023-03-02 10:55:04下载
    积分:1
  • Eternal Lands(永恒大陆)的地图编辑器代码!~你可以选者VC++和DEVCPP进行编译...
    Eternal Lands(永恒大陆)的地图编辑器代码!~你可以选者VC++和DEVCPP进行编译-Eternal Lands (eternal mainland) code of the map editor! ~ You can choose who VC++ And compile DEVCPP
    2022-05-21 20:26:11下载
    积分:1
  • 696518资源总数
  • 106161会员总数
  • 5今日下载