简体   繁体   中英

1G colors in Windows with C++ MFC

I am using Visual C++ 2019 with MFC, on Windows 10 Home Premium. The video mode is 3840*2160 40-60 Hz (AMD FreeSync) 30 bit/pixel: 10 bit / color part, 1 073 741 824 colors.

I can give colors with COLORREF = unsigned int (32 bits), what is interpreted as (red | (green << 8) | (blue << 16)), this has only 16 777 216 colors. How can I give 1 073 741 824 colors? At now, 16M colors is converted to 1G colors. I need the method without conversion.

For example: CDC::SetPixel, FillSolidRect, SetTextColor, SetBkColor, Line, CPen/CBrush constructor, CBitmap, etc. Thank you.

(I want to save the time of conversion. For example, speed of key Page Up/Down in my own IDE is about 10 Hz, what is very slow. I generated the picture in the main memory (with CreateCompatibleBitmap, CreateCompatibleDC, BitBlt). When I drawed directly to the display, this was more slower. I tried SetBkMode OPAQUE and TRANSPARENT so, TextOut and DrawText so.)

GDI does not support 10 bit color. You need to use DirectX.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM