| View previous topic :: View next topic |
| Author |
Message |
iNext Expert Cheater
Reputation: 0
Joined: 06 Aug 2007 Posts: 138
|
Posted: Mon Aug 11, 2008 1:30 pm Post subject: [Delphi] Find RGB color of a pixel at a certain location? |
|
|
| How is it done? Every that I've found on this doesn't work or doesn't do what I want it to do. I want to have Delphi check a specific x, y location (not the pixel under my mouse) and then check to see if the RGB is a certain color. If it is a certain color I'm going to simulate a key press. All I need to know is how to scan a x, y pixel location for it's RGB. I think I can do the rest though.
|
|
| Back to top |
|
 |
Renkokuken GO Moderator
Reputation: 4
Joined: 22 Oct 2006 Posts: 3249
|
Posted: Mon Aug 11, 2008 1:36 pm Post subject: |
|
|
| GetPixel
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon Aug 11, 2008 1:45 pm Post subject: |
|
|
GetPixel
or you can use a DIB, blt your picture into it and hunt some bits.
The second way would probably be faster if you're trying to read a lot of pixels at a time.
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Mon Aug 11, 2008 2:07 pm Post subject: |
|
|
| GetPixel or TCanvas.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Mon Aug 11, 2008 3:42 pm Post subject: |
|
|
declare screencanvas a global (or object global) TCanvas object
| Code: |
screencanvas:=tcanvas.Create;
screencanvas.Handle:=getdc(0);
|
And then you can get the RGB color with screenvanvas.pixels[x,y]
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
iNext Expert Cheater
Reputation: 0
Joined: 06 Aug 2007 Posts: 138
|
Posted: Mon Aug 11, 2008 6:55 pm Post subject: |
|
|
Alright. Thank's everyone. I did know the GetPixel function but there are sooooooo many ways to use it that my mind began to crap up. I really think that a big Delphi help book should be made. It's very hard to come by clear Delphi information now a days. There's no real good Delphi sites.
I think I might try to start on a .chm file or some useful Delphi information in the cheating field since most people use C++ and VB for most cheating related activities.
|
|
| Back to top |
|
 |
|