Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Multiple Device Contexts...

SephirothSephiroth Fayetteville, NC, USAPosts: 1,035Member
OK, I'm trying to smooth out the re-drawing of my map viewing window in the level editor I'm making. I had been just getting the DC and drawing to it, but thatof course flickers, so I figure I can do my own double-buffering with little effort. I added a second DC, made it compatible with the window DC, and draw to it, but don't know quite how to then select it into the window DC.
[code]
...
HDC ChildDC, BufferDC;

ChildDC = GetDC(ChildWnd);
BufferDC = CreateCompatibleDC(ChildDC);

...
//Drawing to BufferDC
...

SelectObject(ChildDC, BufferDC); //Shows an empty screen
[/code]
So how exactly would I go about this? The map size is 32000x32000 pixels, so I thought that using an HBITMAP may be a bad idea. Any ideas?

-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]
Sign In or Register to comment.