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. Dynamic Text on Bitmap Button

Dynamic Text on Bitmap Button

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
3 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.
  • S Offline
    S Offline
    Super Hornet
    wrote on last edited by
    #1

    I have created dynamic buttons and loaded a plain bitmap on them. Now I want to place a text on those bitmapped buttons, how can we do that?

    C 1 Reply Last reply
    0
    • S Super Hornet

      I have created dynamic buttons and loaded a plain bitmap on them. Now I want to place a text on those bitmapped buttons, how can we do that?

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

      As far as i know the "default" buttons given to you by windows don't support both images and text on a button, so i'd say you have 3 possibilities: 1. Use a third party custom button which supports both text and image 2. Handle drawing of the button yourself, you have to be able to draw all its possible states, like pressed, disabled, ... and adding theme support is usually also a good idea 3. This is imho the easiest and simplest solution, draw the text onto the bitmap you place on the buttons. So load the bitmap, draw text on it and feed it to the button. If you need to change the text, load it again, draw the new text, feed it to the button. I hope this helps, good luck.

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

      S 1 Reply Last reply
      0
      • C Code o mat

        As far as i know the "default" buttons given to you by windows don't support both images and text on a button, so i'd say you have 3 possibilities: 1. Use a third party custom button which supports both text and image 2. Handle drawing of the button yourself, you have to be able to draw all its possible states, like pressed, disabled, ... and adding theme support is usually also a good idea 3. This is imho the easiest and simplest solution, draw the text onto the bitmap you place on the buttons. So load the bitmap, draw text on it and feed it to the button. If you need to change the text, load it again, draw the new text, feed it to the button. I hope this helps, good luck.

        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

        S Offline
        S Offline
        Super Hornet
        wrote on last edited by
        #3

        Thnx a-lot I will go with drawing text.

        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