how to draw constantly changing graphics

廉价感情. 提交于 2019-12-03 20:52:47
Jim Mischel

One thing that should speed things up is if you do the GetDC just once and get all of the pixels you need, then call ReleaseDC. So rather than:

for each pixel
  GetDC
  Read Pixel
  ReleaseDC

You have:

GetDC
for each pixel
  read pixel and store value
ReleaseDC

Then process the stored pixels.

That said, you're probably better off not using GetPixel at all, as I seem to remember it being terribly inefficient. I suspect you'd have better performance just grabbing the entire screen into a bitmap and getting the pixels from there. Perhaps the answer to this question will help you: Capture the Screen into a Bitmap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!