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