FGIW6: Visual Basic Version


'*****************************************************************************
'                                                                            *
'  FGIW6.frm                                                                 *
'                                                                            *
'  Demonstrate how to load a Fastgraph/Fonts font file from an FGI library.  *
'                                                                            *
'*****************************************************************************
Dim hPal As Long
Dim hVB As Long, hFGI As Long
Dim cxClient As Long, cyClient As Long
Dim Buffer() As Byte
Private Sub Form_Activate()
   Call fg_realize(hPal)
   Refresh
End Sub
Private Sub Form_Load()
   Dim FileSize As Long
   ScaleMode = 3
   Call fg_setdc(hDC)
   hPal = fg_defpal()
   Call fg_realize(hPal)
   Call fg_vbinit
   hVB = fg_vballoc(320, 200)
   Call fg_vbopen(hVB)
   Call fg_vbcolors
   hFGI = fgi_open(App.Path & "\EXAMPLE.FGI")
   If hFGI = 0 Then
      Call MsgBox("Unable to open FGI file.", vbCritical, "Error")
      Unload Me
      Exit Sub
   End If
   FileSize = fgi_filesize("BRODWY18.FGF", hFGI)
   ReDim Buffer(FileSize)
   Call fgi_readnext(Buffer(0), FileSize, hFGI)
   Call fgi_close(hFGI)
   Call fgf_define(Buffer(0))
   Call fgf_justify(0, 0)
   Call fg_setcolor(255)
   Call fg_fillpage
   Call fg_setcolor(20)
   Call fg_move(160, 100)
   Call fgf_print("BROADWAY FONT", 13)
End Sub
Private Sub Form_Paint()
   Call fg_vbscale(0, fg_getmaxx(), 0, fg_getmaxy(), 0, cxClient - 1, 0, cyClient - 1)
End Sub
Private Sub Form_Resize()
   cxClient = ScaleWidth
   cyClient = ScaleHeight
   Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
   Erase Buffer
   Call fg_vbclose
   Call fg_vbfree(hVB)
   Call fg_vbfin
End Sub

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.