如何编程改变屏幕的颜色数??(100分)

  • 主题发起人 kernel32
  • 开始时间
K

kernel32

Unregistered / Unconfirmed
GUEST, unregistred user!
如256色-->16位色
16位色-->256色?
 

用 API SetPixelFormat看看。
 
能给个可以运行的代码吗?
谢谢
 
说说SetPixelFormat在delphi中的用法啊!!
举个例子!谢谢
 
这是win32 api的帮助,你看看,然后修改几个地方试试
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored

0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};
HDC hdc;
int iPixelFormat;

// get the device context's best-available-match pixel format
iPixelFormat = ChoosePixelFormat(hdc, &pfd);

// make that the device context's current pixel format
SetPixelFormat(hdc, iPixelFormat, &pfd);
 
非常感谢你!!我给你分数!!
可是我是个初手,能否给我一个在delphi下直接可以使用的!!
谢谢!!!
 
顶部