Hello Programmers,
I have run into some issue I see no answer to,
I have a square image divided into four fields. upperleft == red, UpperRight == Blue, LowerLeft == white, Lower right == Green.
I want to know the coloer of each field and click on it to get the text as a start, but it shows me wrong or unexpected answers.
This code:
procedure TForm2.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
c: TColor;
begin
c:=Byte(Form2.Image1.Canvas.Pixels[X,Y]);
Form1.FileNameEdit2.Caption:='X = '+IntToStr(X)+' Y = '+IntToStr(y)+
' Color = '+ColorToString(c);
end;
When I click on red it says : X = 166 Y = 98 Color = $000000FE
click on white: X = 156 Y = 262 Color = clRed
click on Bleu : X = 397 Y = 87 Color = clBlack
click on Green: X = 401 Y = 265 Color = clBlack
The click on white makes me think the coordinatesystem is inverted, but I guesss thats not treu..
The click on white does the same, but blue and green realy puzzles me....
I even have no idea what I do wrong.
So, indeed, any help is epreciated.