background of picture static control
-
iam using static picture control on the dialog box. actually my bitmap has alpha and red background color. this bitmap attached to static picture control. then problem is in Windows XP supporting alpha channel but in Windows 2000 it showing same back ground color . what i want is how can i hide the background color of the static picture control? one more thing i wrote like this
HBRUSH CFileSelectionDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); // TODO: Change any attributes of the DC here if(pWnd->GetDlgCtrlID()==IDC_STATIC_IMG) pDC->SetBkMode(TRANSPARENT); // TODO: Return a different brush if the default is not desired return hbr; }
here IDC_STATIC_IMG is a member variable of static picture control.Regards, Srinivas
-
iam using static picture control on the dialog box. actually my bitmap has alpha and red background color. this bitmap attached to static picture control. then problem is in Windows XP supporting alpha channel but in Windows 2000 it showing same back ground color . what i want is how can i hide the background color of the static picture control? one more thing i wrote like this
HBRUSH CFileSelectionDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); // TODO: Change any attributes of the DC here if(pWnd->GetDlgCtrlID()==IDC_STATIC_IMG) pDC->SetBkMode(TRANSPARENT); // TODO: Return a different brush if the default is not desired return hbr; }
here IDC_STATIC_IMG is a member variable of static picture control.Regards, Srinivas
Try returning the result of GetStockObject(NULL_BRUSH) instead of the brush that the CDialog::OnCtlColor returns