I am assuming you are using Mapbasic, right?

Sub CreatePhotoButton

   Alter ButtonPad ID 1
      Add
         Separator
         ToolButton
         Calling ShowPhoto
         ID 9011
         Icon 117
         Cursor MI_CURSOR_FINGER_UP
         DrawMode  DM_CUSTOM_POINT
         HelpMsg "Show Photo"

End Sub

Sub ShowPhoto

   Dim fCoordX          As Float
   Dim fCoordY          As Float
   Dim objCircle  As object
   Dim alTemp  As Alias
   Dim szPhotoNum       As String
     

   fCoordX = CommandInfo(CMD_INFO_X)
   fCoordY = CommandInfo(CMD_INFO_Y)

   Set Distance Units "ft"
     

   objCircle = CreateCircle(fCoordX, fCoordY, 50)

   Select * from PhotoTable where obj intersects objCircle into   
SelectedPoint

   If TableInfo(SelectedPoint, TAB_INFO_NROWS)  = 1 Then
      Fetch First from SelectedPoint
      alTemp = SelectedPoint.PhotoColumn
      szPhotoNum = alTemp
      '** gszPhotoPath is photo Directory
      If FileExists(gszPhotoPath & szPhotoNum & ".jpg") Then
         Call CreatePhoto(szPhotoNum)
      End If
   End If

End Sub

Sub CreatePhoto(byVal szPhotoNum As String)
 
   Dim szTableName   As String
   szTableName = "C:\Temp\" & szPhotoNum & ".TAB"

   Open File szTableName For Output As #711
   Print #711, "!Table"
   Print #711, "!Version 300"
   Print #711
   Print #711, "Definition Table"
   Print #711, "  File """ + gszPhotoPath & szPhotoNum & ".jpg" + """"
   Print #711, "  Type ""RASTER"" "
   Print #711, "  (1,1) (1,1) Label ""Pt 1"", "
   Print #711, "  (5,1) (5,1) Label ""Pt 2"", "
   Print #711, "  (5,5) (5,5) Label ""Pt 3""  "

   Print #711, "  CoordSys NonEarth Units ""mm"" "
   Print #711, "  Units ""mm"" "
   Print #711, "  RasterStyle 1 50"  ' Brightness; default is 50
   Print #711, "  RasterStyle 2 50"  ' Contrast; default is 50
   Close File #711

   Open Table szPhotoTableName

   Exit Sub

End Sub

Somthing like this should work

Yas
 ----------
From:  Daniel Clark
Sent:  Thursday, October 07, 1999 5:49 AM
To:  [EMAIL PROTECTED]
Subject:  Images in MI

Hello MI'ers

I'm new to MapInfo and I'm trying to set up a project that will contain
images.

What I want to do is:
Create points that, when clicked on with the mouse, will open a small   
image
viewer and display the correct image for that point(eg. photos taken at   
that
location)

How do I go about this?
Any help will be apprieciated.

Cheers,

Dan Clark

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
 ----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to