Todd,
Another try.
You can probably to a little better by using a WITH oCtrl inside the FOR loop.
How many other controls are there on this form that are not vf_images? You can potentially use a custom collection of the image objects that gets constructed just once.
A whole other approach would be to precalculate the boundaries into a cursor something on the order of:
create cursor imagemap ( cname c(32), xmin i, xmax i, ymin i, ymax i )
for each loObject in this.Objects
if ( its an image )
with loObject
insert into imagemap values ( .Name, .Left, .Left + .Width, .Top, .Top + .Height )
endwith
endif
endfor
then your finder code could run a sql
select * ;
from imagemap ;
into cursor thisclick ;
where xmin <= pnX and xmax >= pnX and ;
ymin <= pnY and ymax >= pnY
You now have a list of candidate object names to do your pixel color test on.
>I have a form with 30 - 50 image controls each displaying a transparent background GIF. The images themselves are irregular. The controls are overlapped, creating a mosaic effect, much like a puzzle with each image control containing one piece of the puzzle.
>
>When the user clicks on the mosaic of images, he wants to know which piece has been clicked on.
>The problem is the line oImage.Load(oControl.Picture). To process each image control until I get the desired one can take for 1 to 3 seconds depending on how far down the control list the image control is.