Jump to content
  • Advertisement
Sign in to follow this  
biowarrior

Copy the contents of DC to an array

This topic is 4594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It's looks simple, but I would like to hear better solutions. How can I copy the contents of an handle to memory device context to an array? I would like to transfer the data (pixels) from an off-screen buffer to an array, anyone know how to do that? BitBlt(/* my array here??? */, 0, 0, chartWidth, chartHeight, hdcMem, 0, 0, SRCCOPY); The original code is to transfer from one device context (memory off-screen) to a screen device context, but instead, I want to transfer to an array, how can I do that? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Try GetDIBits.
Of course you'll also have to figure out which format you want it in and create a BITMAPINFO structure desribing it.
Alternatively you could create the source bitmap with CreateDIBSection to get direct access to it's internal buffer.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!