Private Declare Function GetPixel Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer) As Long
Private Declare Function setpixel Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal crColor As Long) As Long
Private Declare Function ellipse Lib "GDI" (ByVal hDC As Integer, ByVal nLeft As Integer, ByVal nTop As Integer, ByVal nRight As Integer, ByVal nBottom As Integer) As Long
Private Declare Function LineTo Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
Private Declare Function Polyline Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
Private Declare Function MoveTo Lib "GDI" (ByVal hDC As Integer, ByVal x As Integer, ByVal y As Integer) As Long
' Constants for Raster Operations used by BitBlt function.
Const SRCAND = &H8800C6 ' dest = source AND dest
Const SRCCOPY = &HCC0020 ' dest = source
Const SRCPAINT = &HEE0086 ' dest = source OR dest
' The BitBlt Windows API call.
Private Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
' The width and height of the work area bitmap (picWork).
Dim WorkWidth As Integer
Dim WorkHeight As Integer
'Scaling Constants
Const XSCALE = 5
Const YSCALE = 3
Private Sub Command1_Click()
Dim iOutNumber, linetok As Integer
Dim xpos, ypos(150) As Integer
Dim token(400) As String 'String to hold line
Dim color As Long
Static iRnd(2) As Integer, iCount As Integer
'frmWrite.Show
' Randomize
iOutNumber = FreeFile
Open "c:\vb\test.dat" For Output As iOutNumber
For linetok = 1 To 400
For iCount = 1 To 150
xpos = (iCount)
ypos(iCount) = linetok
color = GetPixel(terrain.hDC, xpos, ypos(iCount)) 'Mod 16