home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Transparent Drawing"
- ClientHeight = 4485
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 7245
- ForeColor = &H00C0C0C0&
- LinkTopic = "Form1"
- ScaleHeight = 4485
- ScaleWidth = 7245
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command2
- Caption = "Show Polar Grid"
- BeginProperty Font
- Name = "Tahoma"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 4920
- TabIndex = 2
- Top = 3840
- Width = 2295
- End
- Begin VB.CommandButton Command1
- Caption = "Show Linear Grid"
- BeginProperty Font
- Name = "Tahoma"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 4920
- TabIndex = 1
- Top = 3120
- Width = 2295
- End
- Begin VB.PictureBox Picture1
- ForeColor = &H00E0E0E0&
- Height = 4215
- Left = 120
- Picture = "TRGrid.frx":0000
- ScaleHeight = 4155
- ScaleWidth = 4635
- TabIndex = 0
- Top = 120
- Width = 4695
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Sub DrawLinearGrid()
- GridLines = 20
- Picture1.AutoRedraw = False
- GridSpaceX = Int(Picture1.ScaleWidth / GridLines)
- GridSpaceY = Int(Picture1.ScaleHeight / GridLines)
- For i = 0 To GridLines + 1
- Picture1.Line (GridSpaceX * i, 0)-(GridSpaceX * i, Picture1.Height - 1)
- Picture1.Line (0, GridSpaceY * i)-(Picture1.Width - 1, GridSpaceY * i)
- Next
- End Sub
- Sub DrawPolarGrid()
- GridCircles = 20
- Picture1.AutoRedraw = False
- GridRadius = Int(Picture1.ScaleWidth / GridCircles)
- For i = 0 To GridCircles + 1
- Picture1.Circle (Picture1.ScaleWidth / 2, Picture1.ScaleHeight / 2), GridRadius * i
- Next
- Picture1.Line (Picture1.ScaleWidth / 2, 0)-(Picture1.ScaleWidth / 2, Picture1.ScaleHeight)
- Picture1.Line (0, Picture1.ScaleHeight / 2)-(Picture1.ScaleWidth, Picture1.ScaleHeight / 2)
- End Sub
- Private Sub Command1_Click()
- If Command1.Caption = "Show Linear Grid" Then
- Command1.Caption = "Hide Grid"
- DrawLinearGrid
- Else
- Command1.Caption = "Show Linear Grid"
- Picture1.Refresh
- Picture1.AutoRedraw = False
- End If
- End Sub
- Private Sub Command2_Click()
- If Command2.Caption = "Show Polar Grid" Then
- Command2.Caption = "Hide Grid"
- DrawPolarGrid
- Else
- Command2.Caption = "Show Polar Grid"
- Picture1.Refresh
- Picture1.AutoRedraw = False
- End If
- End Sub
-