🔒 Locked
comparing two pixels
Advertisement
Original Post
For very small numbers of pixels probably not. If you want to grab all the pixels in your window, you probably want to do something like create a HBITMAP using CreateCompatibleBitmap, select it into the device context and use GetDIBits. I'm not entirely sure if that will work, it's been a long time since I've done this and the MSDN documentation isn't completely clear - you might have to redraw your window after selecting the bitmap in for instance.
Quote:
Original post by ebikhan
I dont want to use the GDI functions while capturing the screen shot. Any other method to use it like reading Screen Buffer. How can i do it in C/C++ ?
You can't do it just in C/C++. You'd have to copy your rendering surface into an image and save it to disk using one whichever API you are using. Seeing as how I don't know what APIs you're using, I'm affraid I can't get too much more specific than that.
What exactly are you trying to do? It may make more sense to calculate for yourself what the "screen looks like" in an offscreen buffer (or if you're double-buffering or doing something else along those lines, just consult a buffer that you already have!) and compare values within an array of pixel data directly.
Quote:
Original post by ZQJ
For very small numbers of pixels probably not. If you want to grab all the pixels in your window, you probably want to do something like create a HBITMAP using CreateCompatibleBitmap, select it into the device context and use GetDIBits. I'm not entirely sure if that will work, it's been a long time since I've done this and the MSDN documentation isn't completely clear - you might have to redraw your window after selecting the bitmap in for instance.
yeah, i asked because the amount of pixels i'll be comparing will be around 225000000-400000000... lol
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement