Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Joshy

getting pixel data address from DC

This topic is 5936 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

Is there a function or anything that would return the address of some part of the pixel data stored for a handle like a screen or a window? I''d like to get an address like this so I could blit thousands of pixels quickly instead of using getpixel and setpixel that is slower than a glacier''s retreat.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Have a look through the MSDN for DIBSections, they allow you to do big blits, from a memory chunk.

However, the data is going to be format specific (i.e. in 16bit you might have 565 or 555 colour format data)...


Most screen grabber apps do it this way (I think there is an example of a screen grabber in the MSDN...)


Stu

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This link shows how I solved a similar problem...


http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=569aebcd.0201141257.50caacbd%40posting.google.com&rnum=2&prev=/groups%3Fq%3DStuart%2BMiller%2B%252B%2Bwin32%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D569aebcd.0201141257.50caacbd%2540posting.google.com%26rnum%3D2


(I did a search for Stuart Miller + win32 to find this post...)

My sourcecode for my solution is at the bottom of that thread..

DIBSections are very fast. But require that the hardware supports it (otherwise its no quicker than get/setpixel)

Stu

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!