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. Picture Control Question

Picture Control Question

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsarchitecturehelpquestion
5 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.
  • R Offline
    R Offline
    rmnowick
    wrote on last edited by
    #1

    All, I am trying to use the Picture Control tool from the toolbox to add a picture to my main display window. The picture would be a small box located to the right of text string. When I create the picture control, there is an "Image" field whose description reads as follows: Image: When Type is Icon or Bitmap, specifies the identifier of the image to use So, I set the Type filed to either Icon or Bitmap. But, I am unable to enter a file location of the image that I would like to load. When I enter the string C:\Red Button.bmp into the Image field it comes back with the error: The identifier contains illegal characters The bigger picture here is that I have a list of voltages and temperatures being displayed numerically. Next to each one I would like to display either a green, yellow, or red small rectangle to indicate whether the engineering readings are ok or need some type of action. I thought I could just use the picture control to put up pictures of solid colored rectangles, and that the code might be able to change these on the fly somehow. Robert

    B 2 Replies Last reply
    0
    • R rmnowick

      All, I am trying to use the Picture Control tool from the toolbox to add a picture to my main display window. The picture would be a small box located to the right of text string. When I create the picture control, there is an "Image" field whose description reads as follows: Image: When Type is Icon or Bitmap, specifies the identifier of the image to use So, I set the Type filed to either Icon or Bitmap. But, I am unable to enter a file location of the image that I would like to load. When I enter the string C:\Red Button.bmp into the Image field it comes back with the error: The identifier contains illegal characters The bigger picture here is that I have a list of voltages and temperatures being displayed numerically. Next to each one I would like to display either a green, yellow, or red small rectangle to indicate whether the engineering readings are ok or need some type of action. I thought I could just use the picture control to put up pictures of solid colored rectangles, and that the code might be able to change these on the fly somehow. Robert

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

      why don't you just draw a rectangle and specify the color of the solid brush depending on what the reading is? If it's broken, I probably did it bdiamond

      R 1 Reply Last reply
      0
      • B BlackDice

        why don't you just draw a rectangle and specify the color of the solid brush depending on what the reading is? If it's broken, I probably did it bdiamond

        R Offline
        R Offline
        rmnowick
        wrote on last edited by
        #3

        I'm working in Visual C++ (non-MFC). All the information in the help structure seems to show Visual Basic examples. Can you point me to a help topic that would show me how to do what you are suggesting? Yes, if I can call a routine that draws a rectangle of a certain size and color on my main display, that is all that I need to do. Robert

        B 1 Reply Last reply
        0
        • R rmnowick

          All, I am trying to use the Picture Control tool from the toolbox to add a picture to my main display window. The picture would be a small box located to the right of text string. When I create the picture control, there is an "Image" field whose description reads as follows: Image: When Type is Icon or Bitmap, specifies the identifier of the image to use So, I set the Type filed to either Icon or Bitmap. But, I am unable to enter a file location of the image that I would like to load. When I enter the string C:\Red Button.bmp into the Image field it comes back with the error: The identifier contains illegal characters The bigger picture here is that I have a list of voltages and temperatures being displayed numerically. Next to each one I would like to display either a green, yellow, or red small rectangle to indicate whether the engineering readings are ok or need some type of action. I thought I could just use the picture control to put up pictures of solid colored rectangles, and that the code might be able to change these on the fly somehow. Robert

          B Offline
          B Offline
          BlackDice
          wrote on last edited by
          #4

          here's some sample code also. I just put this in my OnButton1() function just to demonstrate. but here's a red rectangle being drawn. Of course you would have to put this in your paint event or something like that.

          CClientDC dc(this);
          		CBrush b( RGB(255, 0, 0));
          		CBrush* pOldBrush = dc.SelectObject(&b);
          		dc.Rectangle(100,100,110,110);
          		dc.SelectObject(pOldBrush);
          

          If it's broken, I probably did it bdiamond

          1 Reply Last reply
          0
          • R rmnowick

            I'm working in Visual C++ (non-MFC). All the information in the help structure seems to show Visual Basic examples. Can you point me to a help topic that would show me how to do what you are suggesting? Yes, if I can call a routine that draws a rectangle of a certain size and color on my main display, that is all that I need to do. Robert

            B Offline
            B Offline
            BlackDice
            wrote on last edited by
            #5

            I just posted an answer using MFC, but these functions are just wrappers for the api's that you should be able to get with C++. I don't know the exact syntax, but it shouldn't be too dissimilar. Sorry I don't know more:( If it's broken, I probably did it bdiamond

            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