In a program where I'm setting a variable to the pixel value at a particular position, it returns a proper result if the form and image is showing on my desktop, but if I click on something else so that the form from the program isn't showing on my desktop, the pixel vaue returns -1. How can I get it to always return the proper result, even if I minimize the form or click on something else so the program's form isn't showing.
eg. pixel1_val:=image1.canvas.pixels[x1+x_count,y1+y_count];
pixel1_val gets set to -1 if the form is minimised.