Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Map an image to a record in a table
Message
De
07/02/1999 14:11:27
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Divers
Thread ID:
00184842
Message ID:
00184893
Vues:
17
>I am building a parts list for the maintenance of a machine.
>I have all the AutoCAD drawings of the machine components.
>What I would like to do is when the user selects a component, an image of that component appears and the user clicks on a part (let's say a specific bolt or nut) and thus the part information appears.
>
>In other words I would like to make a mapped image (as in HTML) and refer to a record in a table.
>
>Does anybody have any idea on how to do this?
>
>Thanks.

That's going to be a little tricky. The first thing that you will have to get out of the way is how to logically store your "hot spots". You will probably need a table that stores information about hot spot coordinates for each picture. something like

CREATE TABLE HotSpots (PictureID I, TopY I, BottomY I, LeftX I, RightX I, ChildID I)

This would be a child table of the one used to store references to the actual pictures.

You could then create the form that will host the pictures. The easiest thing to do would be to assure that each picture shares common "0" coordinates; that is, they all begin at the same left and top spot. Then in your picture control (or whatever control you will host the images in), put code in the click method that will call a look up method using the coordinates of the click.

THISFORM.LookupClick(MyPictureTable.PictureID, MROW("",3),MCOL("",3))

LookupClick
LPARA tnPictureID, nXcoord, nYCoord

SELECT HotSpots
LOCATE FOR PictureID = tnPictureID ;
AND Topy <= nYCoord ;
AND BottomY >= nYCoord ;
AND LeftX <= nXcoord ;
AND RightX >= nXCoord

IF FOUND()
SEEK HotSpots.ChildID IN MyPictureTable ORDER id
THISFORM.Refresh()
ENDIF
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform