Hi,
I’ve been successful in using getcursorlock in a single image, however I’m having issues applying it correctly to multiple images. I have 4 images that I’m trying to extract the x,y pixel value and then automatically close once it measures, I think that has been done successfully.
Currently when I have 4 images open, the first image declares the pixel value and closes as required. Upon subsequent measurements, the other three close abruptly without me being able to make my measurement, however the cursorlock x,y value is posted in results. Any thoughts would be appreciated.
alt=8;
leftButton=16;
insideROI = 32; // requires 1.42i or later
i=0;
centre_x=0;
centre_y=0;
centreValue = getPixel(centre_x,centre_y);
xi=newArray(1);
yi=newArray(1);
x2=-1; y2=-1; z2=-1; flags2=-1;
QAReady=0;
while (QAReady==0 ) {
getCursorLoc(x, y, z, flags);
if (x!=x2 || y!=y2 || z!=z2 || flags!=flags2) {
s = " ";
{
index = Centre.indexAt(x,y);
if((flags&alt!=0)&(flags&leftButton!=0)) {
print(x,y);
drawLine(x-5,y,x+5,y);
drawLine(x,y-5,x,y+5);
close();
}
}
}
}
x2=x; y2=y; z2=z; flags2=flags;
wait(100);