trying to change tha background color of the client area when left mouse button is pressed. SetBkColor doesn't work.
Any Ideas?
trying to change tha background color of the client area when left mouse button is pressed. SetBkColor doesn't work.
Any Ideas?
I think that SetBkColor only works for text ,or something , not sure. What I usally do is that I get the size of the window and paint a BitMap as back ground. You might get some flickering if you resize the window but if you catch the repaint message and return TRUE it works well.
Where exactly do you put the code? Is it in the PROGRAMView construction/destruction code or the diagnostics area? I am interested in how to do that. Thanks.
~Brett Patterson
"Some succeed because they are destined to, others succeed because they are determined to."
~Anonymous
"A shorn scrotum is quite breathtaking, I suggest you try it."
~Dr. Evil
EMT/Firefighter
Eagle Scout
When I do it in a View class I usally do it in the Draw() then it will be updated whenever windows see fit. There also is a WM_message sent when the window is initialized. If I do popup things I use them
Thanks guys!
I used FloodFill.
I'm still really lost in all of this. You probably think I'm a moron, but please bear with me. I'm just beginning. I have looked at the Class Wizard function in C++ 6.0 and can't find the Draw() declaration. I have added the function as a clear type, but the declaration as Draw() and the access as public. I can't seem to figure out what I have to do from then on out. I have done the following things.
I know that this is wrong, but what am I supposed to do? I never learned any of this. Please help me.Code:CSkinning2View::Draw() { Draw(image, background.jpg); Return = TRUE; }
And what exactly is FloodFill?
~Prog.(FOOLISH)Patterson
Last edited by Prog.Patterson; 02-12-2002 at 11:01 AM.
"Some succeed because they are destined to, others succeed because they are determined to."
~Anonymous
"A shorn scrotum is quite breathtaking, I suggest you try it."
~Dr. Evil
EMT/Firefighter
Eagle Scout
Not at all Patterson. I am at work right now and my memory is not with me but I will look when I get home and tell you how to do it.
Ok lets see. if you open the class wizard
Make sure the drop down list have your Programm view selected
In Messages there is something called OnDraw, highlight it and select add function. A window will poppup and you should select OK. Then select edit code. Things that have to do with redrawing your application should be in this function. If you want to paint the screen black you can add this code
Code:void CYourAppView::OnDraw(CDC* pDC) { CClientDC dc(this); CBrush br(RGB(0,0,0)); dc.SelectObject(&br); CRect lRect; GetClientRect(lRect); lRect.NormalizeRect(); CRect *plRect = &lRect; CBrush *pbr = &br; dc.FillRect(plRect,pbr); }
Last edited by Barjor; 02-12-2002 at 10:12 PM.
Thanks for your help. I understand that much of doing just a solid color. Is it the same if I use an image of type BitMap? Could I just call a function like CPaint(image location) and then the rest of the code you posted yesterday? Would that work?
~Prog.Patterson
"Some succeed because they are destined to, others succeed because they are determined to."
~Anonymous
"A shorn scrotum is quite breathtaking, I suggest you try it."
~Dr. Evil
EMT/Firefighter
Eagle Scout
If you want to display a bit map as a background you put the code for doing so in the OnDraw function. The code for displaying a bitmap is alittle bit different. I think there is something on the faq of else you could search the msdn for BitBlt and CDC.