Wednesday, October 6, 2021

COLOR data type

researched: visual C++ COLORREF

    Definitions

  1. COLORREF
  2. The COLORREF value is used to specify an RGB color. C++

    typedef DWORD COLORREF;
    typedef DWORD* LPCOLORREF;

  3. Color Macros
  4. The following macros are used with color:

    • DIBINDEX
    • GetBValue
    • GetGValue
    • GetRValue
    • PALETTEINDEX
    • PALETTERGB
    • RGB

    Misc

  5. How to Turn MacroAssembler into a High Level Language
  6. The power of high level languages resides on the capability of writing human readable syntax that the compiler translates to machine code. All these high level languages, such as "C", VB, Python, ... include structured programming blocks. A structured programming block, is then, a block of instructions that are executed (or not) depending on conditions. MacroAssembler doesn't allow to program blocks such as "IF .. THEN .. ELSE", "WHILE .. WEND", "REPEAT .. UNTIL" or "FOR ..NEXT", but with the definition of macros for these keywords, we can mimic a high level language sintax..

  7. Byte Swapping
  8. I have a COLORREF DWORD value (0x00bbggrr) that I want to convert to a D3DCOLOR DWORD value (0x00rrggbb). As you can see the 2nd and 4th bytes need to be exchanged. Any suggestions would be appreciated..

  9. COLORREF、COLOR、RGB转化总结分析及在VC++中的使用
  10. COLORREF、COLOR、RGB转化总结分析及在VC++中的使用 真彩色是指显示出来的图像颜色与真实世界中颜色非常自然逼真,使得人眼难以区分它们之间的差别。通常使用RGB图像颜色表示法来表现真彩色图像,即用3字节来表示一个真彩色像素的颜色值。Windows采用该方法来表现颜色,其中SDK提供一个名为RGB的宏来将不同的R、G、B颜色值转化为24位的颜色值。其原型如下:

  11. Naming Common Colors
  12. An include file that allows you to specify colors by name instead of RGB value.

  13. COLORREF as RGB or hexadecimal
  14. I have my current code that reads the getPixel from the current cursor position but the return value is just some insane value by COLORREF and I want it to be in RGB. I looked into Microsoft Reference and I found RGB Macro

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

  23. This is a paragraph.

  24. This is a paragraph.

  25. This is a paragraph.

No comments:

Post a Comment