Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Transparency problem

Transparency problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++graphics
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dhiraj kumar Saini
    wrote on last edited by
    #1

    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

    H 1 Reply Last reply
    0
    • D Dhiraj kumar Saini

      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

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      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);

      D 1 Reply Last reply
      0
      • H Hamid Taebi

        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);

        D Offline
        D Offline
        Dhiraj kumar Saini
        wrote on last edited by
        #3

        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

        H C 2 Replies Last reply
        0
        • D Dhiraj kumar Saini

          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

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          Can you show your code?

          1 Reply Last reply
          0
          • D Dhiraj kumar Saini

            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

            C Offline
            C Offline
            Code o mat
            wrote on last edited by
            #5

            Try handling WM_CTLCOLORBTN the same way.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups