I want to load a jpg from a file into a TImage.
I want to "read" the RGB value of individual pixels of the TImage
... AND draw on the TImage.
--------
I can load the jpg with...
Image1.Picture.LoadFromFile('My.jpg');
--
If I haven't loaded a jpg, I can do...
Image1.Picture.Bitmap.canvas.moveto
(Image1.canvas.moveto(10,10);
Image1.Picture.Bitmap.canvas.lineto
(Image1.canvas.moveto(40,40);
(I draw to the bitmap canvas because when I didn't (years ago) the lines drawn would disappear if the image was refreshed.. or something like that.)
I THINK I can read RGB values with...
iRGB:=Image1.Picture.Bitmap.canvas.pixels[15,15];
... That compiles, runs... but I'm not sure the number returned corresponds to what I see at 40,40.
===
Advice welcome! Maybe I need to move the jpg to...
Image1.Picture.Bitmap.canvas ?
Or maybe do drawing and pixel sampling to/ from
Image1.Picture ?
===
What I am trying to do...
I have scanned some sheets of paper with grids on them. These sheets are responses to a multiple choice questionnaire... a row for each question, a column for each allowed response. The respondant makes X's on the sheet to indicate response. All very plain vanilla.
The program I'm trying to make will "read" the sheets, "see" where respondents have made marks. (Eventually, the program will then produce a file tabulating what was on the response forms.)
Why do I want to draw on the image? I want to show where the program is scanning for marks, and mark where it sees them.