【发布时间】:2015-09-27 15:18:03
【问题描述】:
我使用 DWM 创建了一个带有自定义窗口框架的窗口,并引用了Custom Window Frame Using DWM。我尝试使用StretchBlt 向标题栏添加位图。然而,它并没有正确显示。如果在框架上绘制图像会变亮:
如果框架为黑色,则图像可以正常显示。你如何解决这个问题?
HDC hdc;
PAINTSTRUCT ps;
HBITMAP hbm=(HBITMAP)LoadImage(NULL,"C:\\Users\\admin\\Desktop\\Bitmap32.bmp",
IMAGE_BITMAP,166,160,LR_LOADFROMFILE);
hdc=BeginPaint(hWnd,&ps);
HDC hdcMem=CreateCompatibleDC(hdc);
SelectObject(hdcMem,hbm);
StretchBlt(hdc,0,0,166,160,hdcMem,0,0,166,160,SRCCOPY);
DeleteDC(hdcMem);
EndPaint(hWnd,&ps);
【问题讨论】: