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. 3 simple questions

3 simple questions

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++helptutorial
4 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.
  • C Offline
    C Offline
    Chambers
    wrote on last edited by
    #1

    Hi all, I have three simple questions that I just cannot solve : 1. How do I draw text with a transparent background? I have created a CFont structure (with appropriate colour, font and size), but don`t know how to draw its background transparently (it draws the text in a white box and pastes it to the screen) 2. How do I change the MFC default icons that appear in the top left hand corner of the Mainframe and Child frame respectively? 3. How do I change the line that says "MFC Application" when looking at the file in Windows Explorer? Be grateful if someone could help me out, cheers guys, Alan. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:

    B R 2 Replies Last reply
    0
    • C Chambers

      Hi all, I have three simple questions that I just cannot solve : 1. How do I draw text with a transparent background? I have created a CFont structure (with appropriate colour, font and size), but don`t know how to draw its background transparently (it draws the text in a white box and pastes it to the screen) 2. How do I change the MFC default icons that appear in the top left hand corner of the Mainframe and Child frame respectively? 3. How do I change the line that says "MFC Application" when looking at the file in Windows Explorer? Be grateful if someone could help me out, cheers guys, Alan. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:

      B Offline
      B Offline
      Bernhard
      wrote on last edited by
      #2

      1. i guess you should change the backgroundcolor of your output (e.g. determine the rect, draw a rectangle in this color (using a colored pen) and then use DrawText in this rectangle).. but no real transparency, i know. 2. in the resource editor there is an icon, called IDR_MAINFRAME. Change this and it will work (remember changing both the 32x32 and 16x16 icon) 3. resource edit / version / vs_version_info


      "There are three roads to ruin: women, gambling and technicians. The most pleasant is with women, the quickest is with gambling, but the surest is with technicians." Georges Pompidou

      C 1 Reply Last reply
      0
      • B Bernhard

        1. i guess you should change the backgroundcolor of your output (e.g. determine the rect, draw a rectangle in this color (using a colored pen) and then use DrawText in this rectangle).. but no real transparency, i know. 2. in the resource editor there is an icon, called IDR_MAINFRAME. Change this and it will work (remember changing both the 32x32 and 16x16 icon) 3. resource edit / version / vs_version_info


        "There are three roads to ruin: women, gambling and technicians. The most pleasant is with women, the quickest is with gambling, but the surest is with technicians." Georges Pompidou

        C Offline
        C Offline
        Chambers
        wrote on last edited by
        #3

        Thanks for the response, your answers to questions 2 and 3 were cool, I didn`t spot the 16x16 icon and thats why I could change the icon for the app, but not the icons in the app. I would still like to know if text backgrounds and transparency is possible? I would be very surprised if it weren't. Many Thanks Bernhard, Alan. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:

        1 Reply Last reply
        0
        • C Chambers

          Hi all, I have three simple questions that I just cannot solve : 1. How do I draw text with a transparent background? I have created a CFont structure (with appropriate colour, font and size), but don`t know how to draw its background transparently (it draws the text in a white box and pastes it to the screen) 2. How do I change the MFC default icons that appear in the top left hand corner of the Mainframe and Child frame respectively? 3. How do I change the line that says "MFC Application" when looking at the file in Windows Explorer? Be grateful if someone could help me out, cheers guys, Alan. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          ****Chambers wrote: How do I draw text with a transparent background? Call CDC::SetBkMode(); with TRANSPARENT before drawing text. /ravi "There is always one more bug..." ravib@ravib.com http://www.ravib.com

          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