Solved Anyone know how to store screenshot into array? please reply ASAP

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

waynetay

Newbie
Nov 2, 2013
7
172
0
anyone who can please teach me how to store a screenshot into array pls and sorry for my bad english
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,372
78,998
2,414
Pass the target window handle to GetDC(), t will return the the device context of the window.

Pass the device context to CreateCompatibleDC() to create a compatible DC.

Use CreateCompatibleBitmap(), passing in the DC and the size of the window. This returns a handle to a bitmap

Use SelectObject() to select the bitmap

Use BitBlt() to do a bitblock transfer of the selected pixels from the regular DC into the compatible DC using the SRCCOPY raster operation code to do a normal copy.

Create a BITMAP object. Use GetObject() and pass the handle to the bitmap you created.

Create a BITMAPINFOHEADER and define the member vars. Create an array of unsigned chars big enough to fit all the pixels from your bitmap.

Use GetDIBits() passing in the handle to the compatible bitmap, the bitmap header and a pointer to the pixel array. This loads the pixels from the bitmap into the pixel array.

Now parse all that juicy pixel data, search for the colors you're looking for and test the results against your conditionals to decide what to do next.

Don't forget to delete objects and release memory & device contexts.

I believe this is the tutorial I followed where I learned this, courtesy of MSDN: Capturing an Image - Win32 apps

I answered this question on SO: Taking a screenshot, analyzing it, then deleting it

full code here: Source Code - Screenshot Cleaner - Bypass Fairfight & Punkbuster - BitBlt Hook
 
Last edited:

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,187
12,638
76
Depends in which format have you got the image. Is it an array of pixels, a bitmap, etc.
 

marcie

Newbie
Full Member
Nov 13, 2013
6
878
0
This link should be stickied on every forum ever
"Never, ever expect hackers to be able to read closed proprietary document formats like Microsoft Word or Excel. Most hackers react to these about as well as you would to having a pile of steaming pig manure dumped on your doorstep. Even when they can cope, they resent having to do so." THAT LINE THOU :D:D
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods