|
-
Jun 18th, 2002, 08:51 PM
#1
Thread Starter
Addicted Member
painting problem
what is difference between
BeginPaint()
EndPaint()
and
GetDC()
ReleaseDC()
I am getting problem with this.
While using beginpaint and end paint is works well but in another
the objects drawn are flicker.
-
Jun 19th, 2002, 10:48 AM
#2
Frenzied Member
BeginPaint() -- Start Painting To An Object
EndPaint() -- Stop Painting To An Object
and
GetDC() -- Get Device Context (The Device To Paint To)
ReleaseDC() -- Release Device Context (The Device To Paint To)
If you zip up your code (Or if you dont want to do that you can post your problem code) I will take a look at it if you want. With out it I can't really tell you what your problem is
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Jun 19th, 2002, 10:17 PM
#3
Thread Starter
Addicted Member
PAINTSTRUCT pc;
hDc=BeginPaint(hwnd,&pc);
//hDc=GetDC(hwnd);
Rectangle(hDc,10,10,30,40);
Ellipse(hDc,10,10,30,40);
MoveToEx(hDc,20,40,NULL);
LineTo(hDc,100,100);
Polygon(hDc,A,4);
RECT R;
R.top =50;
R.left =50;
R.right =100;
R.bottom=100;
InvertRect(hDc,&R);
//ReleaseDC(hwnd,hDc);
EndPaint(hwnd,&pc);
-
Jun 21st, 2002, 12:13 PM
#4
Frenzied Member
Well I dont see anything that jumps out at me. One thing you might try is to do:
BeginPaint(hwnd,&pc);
EndPaint(hwnd,&pc);
Before the rest of your paint code. Don't ask me why but it seems to take care of the flicker.
Also you need to put back in the ReleaseDC, because if you don't then you have a memory leak. If you are still having problems, then I am going to need to see your whole code.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Jul 7th, 2002, 04:19 AM
#5
Never use the *Paint and the *DC functions together. Use the *Paint functions ONLY in response to the WM_PAINT message, and *DC in all other situations. Then you shouldn't have problems.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|