Easy CImage Question?
-
Hi All, I'm having real difficulty in getting transparency to work in my application. I am drawing an image into the window title bar, the code (in short) is below:
void CThemedDialog::OnNcPaint()
{
// Get device context of the window.
CDC* pWindowDC = GetWindowDC();// Get rectangle of window. CRect rcWindow; GetWindowRect(rcWindow); ///..some basic drawing... m\_bitmapWindowIcon.Draw(pWindowDC->GetSafeHdc(), 5, 5); //even trying with the line below doesn't work! //m\_bitmapWindowIcon.AlphaBlend(pWindowDC->GetSafeHdc(), 5, 5); ReleaseDC(pWindowDC);
m_bitmapWindowIcon
is an ATL::CImage object that is loaded from a png file (I've also tried with a jpeg file). I never get any transparency - just white pixels where the transparent ones should be. Is there something stupid I am doing? I'm pulling my hair out over this! Thanks in advance, Dave -
Hi All, I'm having real difficulty in getting transparency to work in my application. I am drawing an image into the window title bar, the code (in short) is below:
void CThemedDialog::OnNcPaint()
{
// Get device context of the window.
CDC* pWindowDC = GetWindowDC();// Get rectangle of window. CRect rcWindow; GetWindowRect(rcWindow); ///..some basic drawing... m\_bitmapWindowIcon.Draw(pWindowDC->GetSafeHdc(), 5, 5); //even trying with the line below doesn't work! //m\_bitmapWindowIcon.AlphaBlend(pWindowDC->GetSafeHdc(), 5, 5); ReleaseDC(pWindowDC);
m_bitmapWindowIcon
is an ATL::CImage object that is loaded from a png file (I've also tried with a jpeg file). I never get any transparency - just white pixels where the transparent ones should be. Is there something stupid I am doing? I'm pulling my hair out over this! Thanks in advance, DavePlease clear you question :confused: