Blitting with Device Contexts (CDC)

Started by
1 comment, last by atreyu 22 years, 6 months ago
I''m trying to write a custom control for an MFC app I''m working on. The control requires two CDC''s. One for the control''s window (I''m drawing everything myself) and another one as a sort of off screen back buffer. I want to be able to draw everything in the off screen CDC and then bitblt() it onto the control''s window DC. I''m running into a lot of problems. Basically, no matter what I try, the bitblt fails and nothing gets drawn. I must really be messing this up bad. All I really want is a way to draw my stuff in offscreen memory somewhere and then blt it onto my control. CDC''s seem like the best way to do this but I''m at the point where I''ll try anything right now. Thanks, --Ben d e e p s k y . s 5 . c o m "Who is General Failure and why is he reading my disk?"
Advertisement
How do you blt, how does it fail?

[Moved from Gaming]

Magmai Kai Holmlor
- Not For Rent
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
I guess you do all painting operations in the overriden
CWnd::OnPaint member function.
If so, the trouble may be in the way of getting device context.
BitBlt will fail if you use GetDC() instead of creating instance of CPaintDC.
...by the way, how do you implement custom-draw scrollbars?

This topic is closed to new replies.

Advertisement