Anyone know how can I tell the RGB values of a pixel? For example,
I want to run a test and show that pixel[5,7] of Timage is red 200, green 155, blue 240, and use showmessage to show these 3 values on the screen.
Using scanline below, I thought this would get the values with the Buffer defined as Pbytearray, and although this seems to return values, when I copy the image to the canvas as below shows (verifying that it copies the exact image to the canvas to prove that the scanline is getting the right colors), it doesn't look exactly like the Timage, as I was expecting. I've never used scanline before so I may be missing something but I thought this was how it worked. Is there a better way to find out the individual rgb values? I'm using D3.
for j:=0 to Image1.Picture.Height - 1 do
for i:= 0 to Image1.Picture.Width - 1 do
Canvas.Pixels[i,j] := rgb(Buffer[i+0],Buffer[i+1],Buffer[i+2]);