Advertisement

MFC CBitmap error?

Started by March 30, 2001 07:56 PM
3 comments, last by Peter Svensson 23 years, 10 months ago
Hi! I have a problem with drawing bitmaps in mfs. (It''s a SDI application created by the wizard.) It doesn''t matter what i try to do, i can''t get rid of the flicker when i move a bitmap around... What i do is... - Draw some bitmaps (a checker board to be exact.) - Draw bitmaps transparent ontop of the other bitmaps (Checker pieces) How can i get rid of this problem? Ideas and code are appriciated! You can download a early pre alpha release to have a look at teh problem. And yes, i did the graphics all by my self.. :oP http://www.mds.mdh.se/~dal00psn/Chess.exe //Peter - Thanx!
I think that''s a feature of MFC
- 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
Advertisement

You might be able to do a couple things to speed up the rendering:

1) handle the WM_ERASEBKGND message (returning true). It sounds like you are blitting over your whole client area anyway.

2) Blit all of your image data to a memory dc and then blit the whole image to your screen dc. Check out CreateCompatibleDC to start. Or search for offscreen or memory dc''s.

3) Only update those portions of the screen that need updating.

If your already doing these things, then there might be a more fundamental problem that might need to be addressed.

I guess I should have asked if you were using straight GDI functions or if you were using some other library (DirectX)?

HTH,

-Z
Thanx for your input!

I have tried all those things you mentiond but whitout any success :o(

I''m not totaly sure that i got the offscreen blitting right so i gonna fiddle around with it a bit more...

If anyone has any suggestions, please post them!!

//Peter - thanx!
I forgot one thing... I''m only using mfc gdi functions..

//Peter...

This topic is closed to new replies.

Advertisement