FGFW3: Visual Basic Version


'*****************************************************************************
'                                                                            *
'  FGFW3.frm                                                                 *
'                                                                            *
'  Demonstrate how to display strings from two different fonts.              *
'                                                                            *
'*****************************************************************************
Dim hPal As Long
Dim hVB As Long
Dim hAustin As Long, hModern As Long
Dim cxClient As Long, cyClient As Long
Private Sub Form_Activate()
   Call fg_realize(hPal)
   Refresh
End Sub
Private Sub Form_Load()
   ScaleMode = 3
   Call fg_setdc(hDC)
   hPal = fg_defpal()
   Call fg_realize(hPal)
   Call fg_vbinit
   hVB = fg_vballoc(640, 480)
   Call fg_vbopen(hVB)
   Call fg_vbcolors
   hAustin = fgf_load(App.Path & "\AUSTIN36.FGF")
   hModern = fgf_load(App.Path & "\MODERN28.FGF")
   If hAustin = 0 Or hModern = 0 Then
      Call MsgBox("Unable to load font file.", vbCritical, "Error")
      Unload Me
      Exit Sub
   End If
   
   Call fg_setcolor(255)
   Call fg_fillpage
   ' display characters from the Modern font in upper left corner
   Call fg_setcolor(19)
   Call fgf_select(hModern)
   Call fgf_justify(-1, 1)
   Call fgf_print("Modern 28", 9)
   ' display characters from the Austin font in upper right corner
   Call fgf_select(hAustin)
   Call fgf_justify(1, 1)
   Call fg_move(fg_getmaxx(), 0)
   Call fgf_print("Austin 36", 9)
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)
   Call fgf_unload(-1)
   Call fg_vbclose
   Call fg_vbfree(hVB)
   Call fg_vbfin
End Sub

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.