Monomap: Visual Basic Version
In the Visual Basic version, the load event handler calls the program's LoadHello() function to define the values in the Hello array.
'*****************************************************************************
' *
' Monomap.frm *
' *
' This program demonstrates the Fastgraph for Windows monochrome bitmap *
' display functions. *
' *
'*****************************************************************************
Const vbWidth = 320
Const vbHeight = 200
Dim hPal As Long
Dim hVB As Long
Dim cxClient As Long, cyClient As Long
Dim Hello(5 * 8) As Byte
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(vbWidth, vbHeight)
Call fg_vbopen(hVB)
Call fg_vbcolors
Call fg_setcolor(25)
Call fg_fillpage
Call LoadHello
End Sub
Private Sub Form_Paint()
Call fg_vbscale(0, vbWidth - 1, 0, vbHeight - 1, 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 fg_vbclose
Call fg_vbfree(hVB)
Call fg_vbfin
End Sub
Private Sub mnuClipmap_Click()
Call fg_setcolor(25)
Call fg_fillpage
Call fg_setcolor(22)
Call fg_move(-12, vbHeight / 2 + 4)
Call fg_clipmap(Hello(0), 5, 8)
Call fg_vbscale(0, vbWidth - 1, 0, vbHeight - 1, 0, cxClient - 1, 0, cyClient - 1)
End Sub
Private Sub mnuDrawmap_Click()
Call fg_setcolor(25)
Call fg_fillpage
Call fg_setcolor(10)
Call fg_move(vbWidth / 2 - 20, vbHeight / 2 + 4)
Call fg_drawmap(Hello(0), 5, 8)
Call fg_vbscale(0, vbWidth - 1, 0, vbHeight - 1, 0, cxClient - 1, 0, cyClient - 1)
End Sub
Private Sub mnuExit_Click()
Unload Me
End Sub
Private Sub LoadHello()
Hello(0)=&H0: Hello(1)=&H0: Hello(2)=&H0: Hello(3)=&H0: Hello(4)=&H0
Hello(5)=&HCC: Hello(6)=&H78: Hello(7)=&H78: Hello(8)=&H78: Hello(9)=&H78
Hello(10)=&HCC: Hello(11)=&HC0: Hello(12)=&H30: Hello(13)=&H30: Hello(14)=&HCC
Hello(15)=&HCC: Hello(16)=&HFC: Hello(17)=&H30: Hello(18)=&H30: Hello(19)=&HCC
Hello(20)=&HFC: Hello(21)=&HCC: Hello(22)=&H30: Hello(23)=&H30: Hello(24)=&HCC
Hello(25)=&HCC: Hello(26)=&H78: Hello(27)=&H30: Hello(28)=&H30: Hello(29)=&H78
Hello(30)=&HCC: Hello(31)=&H0: Hello(32)=&H30: Hello(33)=&H30: Hello(34)=&H0
Hello(35)=&HCC: Hello(36)=&H0: Hello(37)=&H70: Hello(38)=&H70: Hello(39)=&H0
End Sub
|