[futurebasic] drawing lines on pict fields

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1998 : Group Archive : Group : All Groups

From: Bob Krueger <bkrueger@...>
Date: Mon, 22 Jun 1998 16:17:20 -0500
Hi--
I want to draw some colored lines on a PICT file.  I'll never brag about my
expertise--I just learned how to get a pict file on the screen, and still
don't fully understand.  Each LOCAL FN works individually, but cant get the
line to appear over the map.

Obviously, the REMarks were not original; I copied them also.  The PICT
resource is attached.

Thanks in advance

Bob
-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-==-=-=-=-=-=-=-=-=-==-=-==

'
'       Make sure the resource file contains a picture
'       having the specifiedID number.
'
RESOURCES "PICT.rsrc copy"                        'application's resource file

'------------------- Functions -------------------------
LOCAL FN makeLine
  WINDOW #1
  COORDINATE WINDOW
  PEN 2,2
  COLOR = _zblue
  PLOT 100,100 TO 200,200
END FN

LOCAL
DIM rect.8
LOCAL FN drawPict(pictID%)
  WINDOW #1,"COMMAND '.' TO EXIT"
  myPICT& = FN GETPICTURE(pictID%)                'get handle to PICT 129
  LONG IF FN RESERROR = _noErr                    'valid handle?
    ' got a valid handle so show pict in field
    ' Moved rect inside so that we know we have a valid handle to work
    ' on before trying to get the pict frame
    rect;8 = [myPICT&]+_picFrame                  'get pictures orginal rect
    PICTURE FIELD #1, &myPICT&, @rect, _noframed
  END IF
END FN
'------------------- Main -----------------------------
FN drawPict(129)
FN makeLine
DO
  HANDLEEVENTS
UNTIL gProgramEnds

Attachments: