thomas rehaag
2009-02-27 12:05:56 UTC
Hi,
I use the CImage class to load PNG file and do the alpha blending in a
dialog's OnPaint:
CImage m_imgTest;//in the header file
m_imgTest.Load(_T("test.png"));//in OnInitDialog
//In OnPaint:
CPaintDC dc(this);
m_imgBack.BitBlt((HDC)dc,0,0);//an other image as background
if(!m_imgTest.IsNull())
m_imgTest.AlphaBlend((HDC)dc,5,164);
Somehow the alpha blendig works - I can see the background throug some
parts of my test.png and completely transparent parts of test.png
ain't visible at all.
But there must be something wrong with the alpha function or the alpha
data: parts with a very low alpha are displayed as if they had a high
alpha.
I put the same pictures as back- and foreground into an html file and
started it in IExplore & FireFox. Both programs deliver alpha blending
as expected.
What am I doing wrong?
Best Regards & thanks in advance,
Thomas
I use the CImage class to load PNG file and do the alpha blending in a
dialog's OnPaint:
CImage m_imgTest;//in the header file
m_imgTest.Load(_T("test.png"));//in OnInitDialog
//In OnPaint:
CPaintDC dc(this);
m_imgBack.BitBlt((HDC)dc,0,0);//an other image as background
if(!m_imgTest.IsNull())
m_imgTest.AlphaBlend((HDC)dc,5,164);
Somehow the alpha blendig works - I can see the background throug some
parts of my test.png and completely transparent parts of test.png
ain't visible at all.
But there must be something wrong with the alpha function or the alpha
data: parts with a very low alpha are displayed as if they had a high
alpha.
I put the same pictures as back- and foreground into an html file and
started it in IExplore & FireFox. Both programs deliver alpha blending
as expected.
What am I doing wrong?
Best Regards & thanks in advance,
Thomas