Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Delphi] Find RGB color of a pixel at a certain location?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iNext
Expert Cheater
Reputation: 0

Joined: 06 Aug 2007
Posts: 138

PostPosted: Mon Aug 11, 2008 1:30 pm    Post subject: [Delphi] Find RGB color of a pixel at a certain location? Reply with quote

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
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Mon Aug 11, 2008 1:36 pm    Post subject: Reply with quote

GetPixel
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Aug 11, 2008 1:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Mon Aug 11, 2008 2:07 pm    Post subject: Reply with quote

GetPixel or TCanvas.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25833
Location: The netherlands

PostPosted: Mon Aug 11, 2008 3:42 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
iNext
Expert Cheater
Reputation: 0

Joined: 06 Aug 2007
Posts: 138

PostPosted: Mon Aug 11, 2008 6:55 pm    Post subject: Reply with quote

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. Sad
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. Rolling Eyes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites