Re: Using SetLayeredWindowAttributes for CWnd object.
Hi,
u can handle transparent Childs by use new function in CDC
named AlphaBlit, PseudoCode :
CMemDC is Key like Google :-)
void CPatWnd::OnPaint()
{
CPaintDC dc(this);
CRect rc; GetClientRect(rc); //dc.m_ps.rcPaint
CMemDC MemDc(&dc,this,false,rc);
CDC* pDC(&MemDc);
CDC dcPlot; dcPlot.CreateCompatibleDC(pDC);
CBitmap bitmapPlot;
bitmapPlot.CreateCompatibleBitmap(pDC,rc.Width(),rc.Height());
CBitmap *pbitmapOldPlot(dcPlot.SelectObject(&bitmapPlot));
dcPlot.FillSolidRect(rc,m_pat.m_rgb);
BLENDFUNCTION bld = {AC_SRC_OVER,0,64,0};
pDC->AlphaBlend(0,0,rc.Width(),rc.Height(),&dcPlot,0,0,rc.Width(),rc.Height(),bld);
dcPlot.SelectObject(pbitmapOldPlot);
}
best regards
Karsten schulz
(www.kahnsoft.de)
<sujeet27kulk@gmail.com> schrieb im Newsbeitrag
news:95928ddd-3ab5-46e3-906f-2ffe3cd2011c@a32g2000prf.googlegroups.com...
Hi,
I want set transperacy for CWnd object. if I use
SetLayeredWindowAttributes it works fine for CDialog but its not
working for CWnd object. Which styles I need to set for this work?