I need a little bit of help with a program I am making. I have most of the program made except for this part:
procedure Button1Click (Sender: TObject);
begin
Button1.Click := public int getPixel(int x, int y);
if (R=R+10) or (G=G+10) or (B=B+10) then
// Simulate a key press
keybd_event(VK_NUMPAD4,0xcb,0 , 0);
// Simulate a key release
keybd_event(VK_NUMPAD4,0xcb, KEYEVENTF_KEYUP,0);
else
null // do nothing (can null be used?)...
end;
I know that this isn't right because I get errors when I try to compile the program (errors related to this). This code is suppose to do something like this:
Click on button 1
When button 1 is clicked search for "pixel x, y"'s color
If the red, green, or blue value has increased by 10 then
Simulate a keypress
Else
Do nothing
I can't figure out how to get something equivalent to what I just said. Also during the whole "if RGB increased by 10" bit, the color starts out as black (0,0,0) and if any of the RGB values increase by 10 then the key is pressed but do I need to specify that the color changes from black to another color or can Delphi conclude that if there are any changes then click? I also just wanted to add that this is suppose to find the color of a pixel on a swf loaded up in Delphi made web browser. I am very new to Delphi (I used to use scripting based programs instead of actual programming languages). Please help me anyway you can. If you need me to explain something differently please ask me.