利用GDI+透明图片做了个透明窗体~
当我再次在起上贴图却不能显示~ 只是不能显示(API调用成功)这是为什么呢?当我用png 透明Button的时候,在其上的透明区域为黑色
而我在正常窗体上(非透明窗体)上却可以正常显示透明Button和GDI+贴图我怀疑DC有问题,而我又不知道为什么?
请赐教!
当我再次在起上贴图却不能显示~ 只是不能显示(API调用成功)这是为什么呢?当我用png 透明Button的时候,在其上的透明区域为黑色
而我在正常窗体上(非透明窗体)上却可以正常显示透明Button和GDI+贴图我怀疑DC有问题,而我又不知道为什么?
请赐教!
typedef BOOL (FAR PASCAL * FUNC1)(
HWND hwnd, // handle to the layered window
COLORREF crKey, // specifies the color key
BYTE bAlpha, // value for the blend function
DWORD dwFlags // action
);
HMODULE hModule = GetModuleHandle("user32.dll");
FUNC1 SetLayeredWindowAttributes;
SetLayeredWindowAttributes = (FUNC1) GetProcAddress (hModule, _T( "SetLayeredWindowAttributes" ) ); // 设置分层扩展标记
SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE) | 0x80000L);
// 70% alpha
SetLayeredWindowAttributes(GetSafeHwnd(), 0, (255 * 70) / 100, 0x2);
我也已经解决 !就是新创建个窗口,属性要是transparent
具体Google下吧