Qt C++ Screen Capture using BitBlt

So I got to thinking I wanted to be able to take abitrary screen captures based on some startx/starty -> endx/endy input. I found various sites showing how to do this, but most of them were pretty confusing. I thought I would post the final working code here.

About Jason

I am a 31 year old programmer living in the south of France. I currently work actively in the fields of Ruby/PHP/Javascript and server/website administration.
This entry was posted in c/C++, C/C++ Programming, Tips and Tricks, Topics, Tutorials and tagged , , , . Bookmark the permalink.
  • Chris

    I’m not quite sure what this example has to do with QT. The only thing of QT you seems to use is “qDebug”. Everything else is just plain C++ call to API.

    • Anonymous

      Thanks for you comment 🙂 You are correct, there is no QT relevant code, at the time of writing, and I think even today, there is no real QT-ish way to snap the screen. I spent hours searching for one before I had to figure it out more or less for myself. If that saves someone else some time, I think I can be forgiven the false advertising.

      I was at least using QT Creator when I wrote it.