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. background of picture static control

background of picture static control

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicshelp
2 Posts 2 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.
  • V Offline
    V Offline
    vasu_sri
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • V vasu_sri

      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

      R Offline
      R Offline
      Roger Broomfield
      wrote on last edited by
      #2

      Try returning the result of GetStockObject(NULL_BRUSH) instead of the brush that the CDialog::OnCtlColor returns

      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