Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image Control and GDI+
Message
 
 
To
08/07/2003 12:13:23
Todd Cottengim
Alpine Land Information Services
Redding, California, United States
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00808060
Message ID:
00808301
Views:
13
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.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform