Graphic layers in VC++
-
hi all, for this project i need to display a picture on the background and few icons + txt at different positions on the screen. it's like the background picture is part of layer #0, the icons part of layer #1, the txt part of #2 and so on. like this, it would be possible to display only the picture (layer#0) or the picture and icons (layers#0 + #1) ... does anybody has any idea how to do it ? regards, Fred
-
hi all, for this project i need to display a picture on the background and few icons + txt at different positions on the screen. it's like the background picture is part of layer #0, the icons part of layer #1, the txt part of #2 and so on. like this, it would be possible to display only the picture (layer#0) or the picture and icons (layers#0 + #1) ... does anybody has any idea how to do it ? regards, Fred
There's a lot of ways to handle this situation, depending on your specific requirements. If you are developing a dialog-based app (I'm assuming you use MFC), then a possibility (by no means the only one) is that you paint the background picture as the dialog background (see this post of mine that explains how to do it), and the icons and texts you can create them dynamically as
CButton
s andCStatic
s, respectively, having your dialog as their parent window. Then, depending on the layers you want to depict, you just have to show/hide the controls (you can store pointers to it on some arrays, one for each layer) withShowWindow
. Sorry for this vague explanation, but maybe it's enough to put you on the right track. Good luck. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
hi all, for this project i need to display a picture on the background and few icons + txt at different positions on the screen. it's like the background picture is part of layer #0, the icons part of layer #1, the txt part of #2 and so on. like this, it would be possible to display only the picture (layer#0) or the picture and icons (layers#0 + #1) ... does anybody has any idea how to do it ? regards, Fred
Draw the background in OnEraseBackground and then put the items in the layers into an array. In OnPaint, draw only the items in layers flagged as being visible. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now