VERSION 5.00 Begin VB.Form frmeye BackColor = &H00008000& Caption = "peace symbol automatic drawing program. http://gregvan.tripod.com" ClientHeight = 6705 ClientLeft = 60 ClientTop = 375 ClientWidth = 8850 FillColor = &H00800000& BeginProperty Font Name = "Arial Black" Size = 12 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty LinkTopic = "Form1" ScaleHeight = 26440.1 ScaleMode = 0 'User ScaleWidth = 8850 StartUpPosition = 3 'Windows Default Begin VB.CheckBox chkPrinter Caption = "turn on printer" BeginProperty Font Name = "Arial Black" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 435 Left = 6240 TabIndex = 5 Top = 5520 Width = 2175 End Begin VB.TextBox txtRepeat Height = 495 Left = 7920 TabIndex = 4 Text = "16" Top = 4440 Width = 735 End Begin VB.CommandButton cmdKali Caption = "DRAW" BeginProperty Font Name = "Arial Black" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 6000 TabIndex = 2 Top = 1320 Width = 2175 End Begin VB.CommandButton cmdQuit Caption = "QUIT" BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 6240 TabIndex = 1 Top = 6120 Width = 2175 End Begin VB.PictureBox picOutput AutoRedraw = -1 'True BackColor = &H00FFFFFF& BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 6495 Left = 240 ScaleHeight = 6435 ScaleWidth = 5115 TabIndex = 0 Top = 120 Width = 5175 End Begin VB.Label Label3 BackColor = &H00C0E0FF& Caption = "CLICK ON THE ""DRAW"" BUTTON TO CREATE A PICTURE..." Height = 1095 Left = 5520 TabIndex = 7 Top = 120 Width = 3135 End Begin VB.Label Label2 BackColor = &H00C0E0FF& Caption = "TO PRINT THE DRAWING... 1. check the ""turn on printer"" BOX 2.click on ""DRAW"" button 3.click on ""Quit"" button " BeginProperty Font Name = "Courier" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 1095 Left = 5640 TabIndex = 6 Top = 1920 Width = 3015 End Begin VB.Label Label1 BackColor = &H00C0E0FF& Caption = "OPTIONAL DENSITY CONTROL... 5=not too dense, 45 = really dense...16=average..." BeginProperty Font Name = "Times New Roman" Size = 9.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00400040& Height = 1095 Left = 5640 TabIndex = 3 Top = 4200 Width = 2055 End End Attribute VB_Name = "frmeye" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False 'Visual Basic program that paints a 'EYE on the screen... with optional printer... 'other Kaleidoscope programs can be found at: 'http://gregvan.tripod.com 'This project is called eye1.vbp 'this form is called frmeye1.frm 'fred1 and sue1 are used to store the random numbers 'so the printout will be identical to the monitor 'I put them outside of the cmdKali_Click so that they 'will not be reset to zero by clicking on the button... Dim sue1 As Integer Dim fred1 As Integer Private Sub cmdKali_Click() 'when you push the "Start Kaleidoscope" button 'this part of the program executes... Dim fred As Integer, sue As Integer 'fred and sue are variables used for location of 'the endpoints of lines and to change the color also Dim pete As Integer 'pete and petenum are used to control how many radiating lines are drawn Dim peteNum As Integer ' c and cc are used to calculate colors Dim c As Single Dim cc As Single Dim dd As Single peteNum = Val(txtRepeat) If peteNum < 1 Then peteNum = 16 If peteNum > 45 Then peteNum = 16 'get a number from the box on the screen 'and use it for a loop counter... default = 16 If chkPrinter.Value = 1 Then 'see if they have checked the "turn on printer" box 'we only want new random numbers when box is NOT checked Else Randomize 'generate some random numbers sue = Int(Rnd * 400) sue = sue - 200 'sue can be from -200 to 200 fred = Int(Rnd * 300) fred = fred - 150 'fred can be from -150 to 150 'store those numbers in sue1 and fred1 'so we can use them again if the printer checkbox is checked 'they control the color scheme... sue1 = sue fred1 = fred End If picOutput.Cls 'set the scale of the picture box 640 tall by 480 wide ' the lower left corner is 0,0 'the upper right corner is 480,640 picOutput.Scale (0, 640)-(480, 0) If chkPrinter.Value = 1 Then 'get those random numbers we saved 'so we can use them to drive the printer sue = sue1 fred = fred1 'set the printer scale... do this only when box is checked 'A MYSTERY HAPPENS WHEN I PRINT... 'THE PRINT IS BACKWARDS... THE LEFT HAND SIDE OF THE DRAWING PRINTS ON THE RIGHT !!! Printer.Scale (0, 640)-(480, 0) End If 'initialize up-down counter factors for endpoints of lines Dim suef As Integer 'suefactor suef = -4 Dim fredf As Integer 'fredfactor fredf = 6 'set color to zero c = 0 'some loops to repeat the radial line plotting For re = 1 To 8 'you can change the value of peteNum by typing into a textbox during execution... For pete = 1 To peteNum For joe = 1 To pete 'up-down counter for fred...it increases fred until a threshhold 'is reached then it decreases fred until another threshhold is 'reached then it increases fred... "a triangle wave oscillator" fred = fred + fredf If fred < -400 Then fredf = 6 If fred > 400 Then fredf = -3 sue = sue + suef If sue > 350 Then suef = -4 If sue < -350 Then suef = 5 'do some math to change the color c = c + sue - fred 'make sure the color number is valid 'I think that the largest number for a color is 16 million If c > 16000000 Then c = c - 16000000 If c < 1 Then c = c + 16000000 'calculate the endpoints of the lines 'We use x to represent horizontal distances 'increasing from left to right 'We use y to represent vertical distances 'increasing from bottom to top...Just like geometry class x = fred + sue y = sue - fred 'draw the lines that radiate from the center of the drawing 'these show on the screen... 'picOutput.line(endpointX,Y)-(otherendpointX,Y),COLOR picOutput.Line (240 + x, 320 + y)-(240 - x, 320 - y), c picOutput.Line (240 - x, 320 + y)-(240 + x, 320 - y), c If chkPrinter.Value = 1 Then 'these are printed by the printer Printer.Line (240 + x, 320 + y)-(240 - x, 320 - y), c Printer.Line (240 - x, 320 + y)-(240 + x, 320 - y), c End If Next joe Next pete Next re 'the format for a circle is... 'picOutput.Circle(centerX,centerY),diameter,color Dim klaatu As Single For klaatu = 1 To 110 Step 0.2 picOutput.Circle (240, 320), klaatu, vbWhite If chkPrinter.Value = 1 Then Printer.Circle (240, 320), klaatu, vbWhite End If Next klaatu For d = 95 To 105 Step 0.3 dd = d - 100 picOutput.Circle (240, 320), d, vbBlack picOutput.Line (240 - dd - dd, 220)-(240 + dd, 320), vbBlack picOutput.Line (240 + dd, 320)-(240 - dd - dd, 420), vbBlack picOutput.Line (240 - dd, 320 + dd)-(180 + dd, 240 - dd), vbBlack picOutput.Line (240 + dd, 320 + dd)-(300 - dd, 240 - dd), vbBlack If chkPrinter.Value = 1 Then Printer.Circle (240, 320), d, vbBlack Printer.Line (240 - dd - dd, 220)-(240 + dd, 320), vbBlack Printer.Line (240 + dd, 320)-(240 - dd - dd, 420), vbBlack Printer.Line (240 - dd, 320 + dd)-(180 + dd, 240 - dd), vbBlack Printer.Line (240 + dd, 320 + dd)-(300 - dd, 240 - dd), vbBlack End If Next d 'make the color radically different than the radiating lines 'draw an oval near the edge of the paper cc = 16000000 - c For t = -100 To 300 Step 3 cc = cc + 391 If cc > 16000000 Then cc = cc - 16000000 picOutput.Line (300 - t, 0)-(0, 0 + t), cc picOutput.Line (180 + t, 0)-(480, 0 + t), cc picOutput.Line (300 - t, 640)-(0, 640 - t), cc picOutput.Line (180 + t, 640)-(480, 640 - t), cc If chkPrinter.Value = 1 Then Printer.Line (300 - t, 0)-(0, 0 + t), cc Printer.Line (180 + t, 0)-(480, 0 + t), cc Printer.Line (300 - t, 640)-(0, 640 - t), cc Printer.Line (180 + t, 640)-(480, 640 - t), cc End If Next t Dim hal As Integer 'hal-the computer in 2001 'draw pyramids as part of the frame For ha = 0 To 75 hal = ha + ha + ha + ha 'much humor here... cc = cc + 2303 'color changer If cc > 16000000 Then cc = cc - 16000000 'top and bottom pyramids picOutput.Line (120 + hal, 0)-(240, ha), cc picOutput.Line (360 - hal, 0)-(240, ha), cc picOutput.Line (120 + hal, 640)-(240, 640 - ha), cc picOutput.Line (360 - hal, 640)-(240, 640 - ha), cc 'side pyramids picOutput.Line (0, 200 + hal)-(ha, 320), cc picOutput.Line (0, 440 - hal)-(ha, 320), cc picOutput.Line (480, 200 + hal)-(480 - ha, 320), cc picOutput.Line (480, 440 - hal)-(480 - ha, 320), cc If chkPrinter.Value = 1 Then 'top and bottom pyramids Printer.Line (120 + hal, 0)-(240, ha), cc Printer.Line (360 - hal, 0)-(240, ha), cc Printer.Line (120 + hal, 640)-(240, 640 - ha), cc Printer.Line (360 - hal, 640)-(240, 640 - ha), cc 'side pyramids Printer.Line (0, 200 + hal)-(ha, 320), cc Printer.Line (0, 440 - hal)-(ha, 320), cc Printer.Line (480, 200 + hal)-(480 - ha, 320), cc Printer.Line (480, 440 - hal)-(480 - ha, 320), cc End If Next ha Dim lad As Integer Dim lad1 As Integer lad1 = peteNum For lad = 1 To 75 Step 2 lad1 = lad1 + 3 If lad1 > 50 Then lad1 = 1 x = lad y = lad1 c = c + &H10213 If c > &HFFFFFF Then c = c - &HFFFFFF picOutput.Line (120 + x, 120 + y)-(120 - x, 120 - y), c picOutput.Line (120 - x, 120 + y)-(120 + x, 120 - y), c picOutput.Line (120 + x, 520 + y)-(120 - x, 520 - y), c picOutput.Line (120 - x, 520 + y)-(120 + x, 520 - y), c picOutput.Line (360 + x, 120 + y)-(360 - x, 120 - y), c picOutput.Line (360 - x, 120 + y)-(360 + x, 120 - y), c picOutput.Line (360 + x, 520 + y)-(360 - x, 520 - y), c picOutput.Line (360 - x, 520 + y)-(360 + x, 520 - y), c If chkPrinter.Value = 1 Then Printer.Line (120 + x, 120 + y)-(120 - x, 120 - y), c Printer.Line (120 - x, 120 + y)-(120 + x, 120 - y), c Printer.Line (120 + x, 520 + y)-(120 - x, 520 - y), c Printer.Line (120 - x, 520 + y)-(120 + x, 520 - y), c Printer.Line (360 + x, 120 + y)-(360 - x, 120 - y), c Printer.Line (360 - x, 120 + y)-(360 + x, 120 - y), c Printer.Line (360 + x, 520 + y)-(360 - x, 520 - y), c Printer.Line (360 - x, 520 + y)-(360 + x, 520 - y), c End If Next lad End Sub Private Sub cmdQuit_Click() Unload frmeye End End Sub