请教VC++如何创建256色的BMP图案(100分)

  • 主题发起人 主题发起人 youbang
  • 开始时间 开始时间
Y

youbang

Unregistered / Unconfirmed
GUEST, unregistred user!
没用过VC++开发过多媒体,我想是API函数SetPixelFormat吧。
HDC hdc;
int iPixelFormat;
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA type
8, // 8-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
0, //
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};
iPixelFormat = ChoosePixelFormat(hdc, &pfd);
SetPixelFormat(hdc, iPixelFormat, &pfd);

 
后退
顶部