Transparency problem
-
Hello, I am working on an. mfc application. In it there is a picture control which contains a bitmap image. On this images i am placing a radio button control. The problem is that the background color of radio button is the window default color and the bitmap color is blue. I want to make the background colour of radio button either transparent or colour it with blue colour. Please help me. Thanks
-
Hello, I am working on an. mfc application. In it there is a picture control which contains a bitmap image. On this images i am placing a radio button control. The problem is that the background color of radio button is the window default color and the bitmap color is blue. I want to make the background colour of radio button either transparent or colour it with blue colour. Please help me. Thanks
You must be get color of your image and then use of it on the WM_CTLCOLOR for radiobutton like this: HBRUSH CasdDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); pDC->SetBkColor(RGB(53,97,200)); pDC->SetTextColor(RGB(53,97,200)); return hbr; } if you are using of a color on your image you can use of COLORREF color=GetPixel(hdc,x,y);
-
You must be get color of your image and then use of it on the WM_CTLCOLOR for radiobutton like this: HBRUSH CasdDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); pDC->SetBkColor(RGB(53,97,200)); pDC->SetTextColor(RGB(53,97,200)); return hbr; } if you are using of a color on your image you can use of COLORREF color=GetPixel(hdc,x,y);
I got colour of the image and used the aboved code but it is not changing the background colour of the radio button. Rather it is changing the colour of certain edit boxes and static controls. Please help me. Dhiraj
-
I got colour of the image and used the aboved code but it is not changing the background colour of the radio button. Rather it is changing the colour of certain edit boxes and static controls. Please help me. Dhiraj
Can you show your code?
-
I got colour of the image and used the aboved code but it is not changing the background colour of the radio button. Rather it is changing the colour of certain edit boxes and static controls. Please help me. Dhiraj
Try handling WM_CTLCOLORBTN the same way.