Problem:Need to show an image depending on the options selected.
-
I want to open a window,that will have a text field,several "combo box" with some options,a "Ok" button, and another field where I want to show an image(initially empty). After selecting the desired options and pressing the "Ok" button,I want to show an image. The image shown will deppend on the options. Can you tell me please how can I do this? (*Clarification*: The image is not an image on the disk,but something that will be generated from the options selected)
-
I want to open a window,that will have a text field,several "combo box" with some options,a "Ok" button, and another field where I want to show an image(initially empty). After selecting the desired options and pressing the "Ok" button,I want to show an image. The image shown will deppend on the options. Can you tell me please how can I do this? (*Clarification*: The image is not an image on the disk,but something that will be generated from the options selected)
Make the image a bitmap, assign it a name, like IDC_IMAGE. In the class wizard, go to member variables and Add Variable, and make it a control called m_image. Then import or create the bitmaps you want. In the Init Dialog section after it says, add extra initilization here, put VERIFY(picture1.LoadBitmap(IDB_MYPICTURE1)); VERIFY(picture2.LoadBitmap(IDB_MYPICTURE2)); Create two variables of CBitmap type and name them picture1 and picture 2. Then, in the part where you make your choice, if (buttonpressed==1) m_image.SetBitmap(picture1); if (buttonpressed==2) m_image.SetBitmap(picture2); I don't think I left anything out, and this works for me in visual c++ 6. Dimenser
-
Make the image a bitmap, assign it a name, like IDC_IMAGE. In the class wizard, go to member variables and Add Variable, and make it a control called m_image. Then import or create the bitmaps you want. In the Init Dialog section after it says, add extra initilization here, put VERIFY(picture1.LoadBitmap(IDB_MYPICTURE1)); VERIFY(picture2.LoadBitmap(IDB_MYPICTURE2)); Create two variables of CBitmap type and name them picture1 and picture 2. Then, in the part where you make your choice, if (buttonpressed==1) m_image.SetBitmap(picture1); if (buttonpressed==2) m_image.SetBitmap(picture2); I don't think I left anything out, and this works for me in visual c++ 6. Dimenser
I have something like this: CDC* my_DC; my_DC = new CDC; my_DC -> CreateCompatibleDC(NULL); my_DC -> PatBlt(0,0,my_size,my_size,WHITENESS); for (int i = 0; i < my_size; ++i ) for (int j = 0; j < my_size; ++j ) if (result[i][j]) my_DC->SetPixel( i, j, RGB(0, 0, 0)); How can I make a Bitmap from that? Thanks!