Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Here is a small code snippet:
C++
class staticbitmap : public CStatic {
    // ...
};

staticbitmap pic[4];

hbm[i] = (HBITMAP)LoadImage(NULL, filepath[i], IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
GetObject(hbm[i], sizeof(bm[i]), &bm[i]);
buf[i] = reinterpret_cast<unsigned char*>(bm[i].bmBits);

// Play with buf[i]
// ...

pic[i].SetBitmap(hbm[i]);


My program rotates the picture when user clicks on it an moves his mouse.

Why does it flicker even though there is only one thread in my MFC application? Theoretically there is no chance of parallel access. How does double buffering then solve this problem?

Thanks
Kaushik SV
Posted

1 solution

Flicker is not due to parallel access. You should read one (or more) of the Code Project articles[^] on this very argument.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900