home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Starfield_2147143182009.psc / Form1.frm < prev   
Text File  |  2009-03-18  |  19KB  |  510 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   0  'None
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   5790
  6.    ClientLeft      =   0
  7.    ClientTop       =   0
  8.    ClientWidth     =   7755
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   386
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   517
  13.    ShowInTaskbar   =   0   'False
  14.    StartUpPosition =   2  'CenterScreen
  15.    WindowState     =   1  'Minimized
  16.    Begin VB.Timer Timer1 
  17.       Enabled         =   0   'False
  18.       Interval        =   10
  19.       Left            =   6120
  20.       Top             =   3300
  21.    End
  22. End
  23. Attribute VB_Name = "Form1"
  24. Attribute VB_GlobalNameSpace = False
  25. Attribute VB_Creatable = False
  26. Attribute VB_PredeclaredId = True
  27. Attribute VB_Exposed = False
  28. Option Explicit
  29.  
  30. Private Type POINTAPI
  31.     x As Long
  32.     y As Long
  33. End Type
  34.  
  35. Private Type udtStar
  36.     r As Long
  37.     x As Long
  38.     y As Long
  39.     a As Single
  40.     spd As Long
  41.     q As Long
  42.     w As Long
  43.     offScreen As Long
  44.     qi As Long
  45.     wi As Long
  46. End Type
  47.  
  48.  
  49. Private Declare Function Rectangle Lib "gdi32" (ByVal hDC As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
  50. Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
  51. Private Declare Function FrameRgn Lib "gdi32" (ByVal hDC As Long, ByVal hRgn As Long, ByVal hBrush As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
  52. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cX As Long, ByVal cY As Long, ByVal wFlags As Long) As Long
  53. Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hDC As Long) As Long
  54. Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hDC As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
  55. Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal iCapabilitiy As Long) As Long
  56. Private Declare Function GetSystemPaletteEntries Lib "gdi32" (ByVal hDC As Long, ByVal wStartIndex As Long, ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) As Long
  57. Private Declare Function CreatePalette Lib "gdi32" (lpLogPalette As LOGPALETTE) As Long
  58. Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
  59. Private Declare Function BitBlt Lib "gdi32" (ByVal hdcDest As Long, ByVal XDest As Long, ByVal YDest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hdcSrc As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
  60. Private Declare Function DeleteDC Lib "gdi32" (ByVal hDC As Long) As Long
  61. Private Declare Function GetForegroundWindow Lib "user32" () As Long
  62. Private Declare Function SelectPalette Lib "gdi32" (ByVal hDC As Long, ByVal HPALETTE As Long, ByVal bForceBackground As Long) As Long
  63. Private Declare Function RealizePalette Lib "gdi32" (ByVal hDC As Long) As Long
  64. Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
  65. Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
  66. Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
  67. Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hDC As Long) As Long
  68. Private Declare Function GetDesktopWindow Lib "user32" () As Long
  69. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  70. Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long
  71. Private Declare Function SetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
  72. Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
  73. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  74. Private Declare Function SetBkMode Lib "gdi32" (ByVal hDC As Long, ByVal nBkMode As Long) As Long
  75. Private Declare Function StretchDIBits& Lib "gdi32" (ByVal hDC&, ByVal x&, ByVal y&, ByVal dX&, ByVal dy&, ByVal SrcX&, ByVal SrcY&, ByVal Srcdx&, ByVal Srcdy&, Bits As Any, BInf As Any, ByVal Usage&, ByVal Rop&)
  76. Private Declare Function LineTo Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long
  77. Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
  78. Private Declare Function MoveToEx Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
  79. Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
  80. Private Declare Function SetTextColor Lib "gdi32" (ByVal hDC As Long, ByVal crColor As Long) As Long
  81. Private Declare Function GetTickCount Lib "kernel32.dll" () As Long
  82. Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
  83. Private Declare Function SetRect Lib "user32" (lpRect As RECT, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
  84. Private Declare Function FillRect Lib "user32" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
  85. Private Declare Function CreateFont Lib "gdi32" Alias "CreateFontA" (ByVal nHeight As Long, ByVal nWidth As Long, ByVal nEscapement As Long, ByVal nOrientation As Long, ByVal fnWeight As Long, ByVal fdwItalic As Boolean, ByVal fdwUnderline As Boolean, ByVal fdwStrikeOut As Boolean, ByVal fdwCharSet As Long, ByVal fdwOutputPrecision As Long, ByVal fdwClipPrecision As Long, ByVal fdwQuality As Long, ByVal fdwPitchAndFamily As Long, ByVal lpszFace As String) As Long
  86. Private Declare Function MulDiv Lib "kernel32" (ByVal nNumber As Long, ByVal nNumerator As Long, ByVal nDenominator As Long) As Long
  87. Private Declare Function ShowCursor Lib "user32" (ByVal fShow As Integer) As Integer
  88. Private Declare Function CreateBrushIndirect Lib "gdi32" (lpLogBrush As LOGBRUSH) As Long
  89. Private Declare Function OleTranslateColor Lib "olepro32.dll" (ByVal OLE_COLOR As Long, ByVal HPALETTE As Long, pccolorref As Long) As Long
  90. Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
  91. Private Declare Function AlphaBlend Lib "msimg32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal widthSrc As Long, ByVal heightSrc As Long, ByVal blendFunct As Long) As Boolean
  92. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSrc As Any, ByVal ByteLen As Long)
  93.  
  94. Private Type BLENDFUNCTION
  95.     BlendOp As Byte
  96.     BlendFlags As Byte
  97.     SourceConstantAlpha As Byte
  98.     AlphaFormat As Byte
  99. End Type
  100. ' BlendOp:
  101. Private Const AC_SRC_OVER = &H0
  102. ' AlphaFormat:
  103. Private Const AC_SRC_ALPHA = &H1
  104.  
  105. Private Enum eBrushStyle
  106.     gdiBSDibPattern = 5
  107.     gdiBSDibPatternPt = 6
  108.     gdiBSHatched = 2
  109.     gdiBSNull = 1
  110.     gdiBSPattern = 3
  111.     gdiBSSolid = 0
  112. End Enum
  113. Private Type uSquare
  114.     nSize As Long
  115.     xPos As Long
  116.     yPos As Long
  117.     xSpd As Long
  118.     ySpd As Long
  119.     Angle As Single
  120.     StarSpd As Long
  121. End Type
  122.  
  123. Private mRows As Long
  124. Private mCols As Long
  125. Private mFixedGrid As Boolean
  126.  
  127.  
  128. Private Type PALETTEENTRY
  129.    peRed As Byte
  130.    peGreen As Byte
  131.    peBlue As Byte
  132.    peFlags As Byte
  133. End Type
  134. Private Const SRCCOPY = &HCC0020
  135.  
  136. Private Type LOGPALETTE
  137.    palVersion As Integer
  138.    palNumEntries As Integer
  139.    palPalEntry(255) As PALETTEENTRY  ' Enough for 256 colors.
  140. End Type
  141.  
  142. Private Type GUID
  143.    Data1 As Long
  144.    Data2 As Integer
  145.    Data3 As Integer
  146.    Data4(7) As Byte
  147. End Type
  148.  
  149. Private Const RASTERCAPS As Long = 38
  150. Private Const RC_PALETTE As Long = &H100
  151. Private Const SIZEPALETTE As Long = 104
  152.  
  153. Private Type RECT
  154.    Left As Long
  155.    Top As Long
  156.    right As Long
  157.    bottom As Long
  158. End Type
  159. Private Type PicBmp
  160.    Size As Long
  161.    Type As Long
  162.    hBmp As Long
  163.    hPal As Long
  164.    Reserved As Long
  165. End Type
  166.  
  167. Private Type LOGBRUSH
  168.     lbStyle As Long
  169.     lbColor As Long
  170.     lbHatch As Long
  171. End Type
  172.  
  173. Const Pi As Single = 3.14159265358978
  174. Const LOGPIXELSY = 90
  175. Const COLOR_WINDOW = 5
  176. Const Message = "Hello !"
  177. Const OPAQUE = 2
  178. Const TRANSPARENT = 1
  179. Const FW_DONTCARE = 0
  180. Const FW_THIN = 100
  181. Const FW_EXTRALIGHT = 200
  182. Const FW_LIGHT = 300
  183. Const FW_NORMAL = 400
  184. Const FW_MEDIUM = 500
  185. Const FW_SEMIBOLD = 600
  186. Const FW_BOLD = 700
  187. Const FW_EXTRABOLD = 800
  188. Const FW_HEAVY = 900
  189. Const FW_BLACK = FW_HEAVY
  190. Const FW_DEMIBOLD = FW_SEMIBOLD
  191. Const FW_REGULAR = FW_NORMAL
  192. Const FW_ULTRABOLD = FW_EXTRABOLD
  193. Const FW_ULTRALIGHT = FW_EXTRALIGHT
  194. 'used with fdwCharSet
  195. Const ANSI_CHARSET = 0
  196. Const DEFAULT_CHARSET = 1
  197. Const SYMBOL_CHARSET = 2
  198. Const SHIFTJIS_CHARSET = 128
  199. Const HANGEUL_CHARSET = 129
  200. Const CHINESEBIG5_CHARSET = 136
  201. Const OEM_CHARSET = 255
  202. 'used with fdwOutputPrecision
  203. Const OUT_CHARACTER_PRECIS = 2
  204. Const OUT_DEFAULT_PRECIS = 0
  205. Const OUT_DEVICE_PRECIS = 5
  206. 'used with fdwClipPrecision
  207. Const CLIP_DEFAULT_PRECIS = 0
  208. Const CLIP_CHARACTER_PRECIS = 1
  209. Const CLIP_STROKE_PRECIS = 2
  210. 'used with fdwQuality
  211. Const DEFAULT_QUALITY = 0
  212. Const DRAFT_QUALITY = 1
  213. Const PROOF_QUALITY = 2
  214. 'used with fdwPitchAndFamily
  215. Const DEFAULT_PITCH = 0
  216. Const FIXED_PITCH = 1
  217. Const VARIABLE_PITCH = 2
  218.  
  219. Private bStop As Boolean
  220. Private scrL As Long
  221. Private scrT As Long
  222. Private scrW As Long
  223. Private scrH As Long
  224. Private scrR As Long
  225. Private scrB As Long
  226. Private midX As Long
  227. Private midY As Long
  228. Private mBlankDIB As cDIBSection
  229. Private mBufferDIB As cDIBSection
  230.  
  231. Private bBUILDMODE As Boolean
  232. Private CMM As cMonitors
  233. Private uStars() As udtStar
  234.  
  235.  
  236. Private Sub ApplyBlend()
  237. Dim Blend As BLENDFUNCTION
  238. Dim BlendPtr As Long
  239.     Blend.SourceConstantAlpha = 60 '255 no blend - 0 major blurry!!
  240.     
  241.     CopyMemory BlendPtr, Blend, 4
  242.     
  243.     AlphaBlend mBufferDIB.hDC, scrL, scrT, scrW, scrH, mBlankDIB.hDC, 0, 0, scrW, scrH, BlendPtr
  244. End Sub
  245.  
  246. Private Function CreateMyFont(nSize&, sFontFace$, bBold As Boolean, bItalic As Boolean) As Long
  247. Static r&, d&
  248.  
  249.     DeleteDC r: r = GetDC(0)
  250.     d = GetDeviceCaps(r, LOGPIXELSY)
  251.     CreateMyFont = CreateFont(-MulDiv(nSize, d, 72), 0, 0, 0, _
  252.                               IIf(bBold, FW_BOLD, FW_NORMAL), bItalic, False, False, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, _
  253.                               CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH, sFontFace) 'gdi 2
  254. End Function
  255. Private Sub SplitRGB(ByVal clr&, r&, g&, b&)
  256.     r = clr And &HFF: g = (clr \ &H100&) And &HFF: b = (clr \ &H10000) And &HFF
  257. End Sub
  258. Private Sub SetFont(DC&, sFace$, nSize&)
  259. Static c&
  260.     ReleaseDC DC, c: DeleteDC c
  261.     c = CreateMyFont(nSize, sFace, False, False)
  262.     DeleteObject SelectObject(DC, c)
  263. End Sub
  264.  
  265. Private Sub Form_Click()
  266. bStop = True
  267. End Sub
  268.  
  269. Private Sub Form_DblClick()
  270. bStop = True
  271. End Sub
  272.  
  273.  
  274.  
  275. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  276. bStop = True
  277. End Sub
  278.  
  279. Private Sub Form_Load()
  280.  
  281. If Mid$(Command(), 2, 1) = "p" Then End
  282. If Mid$(Command(), 2, 1) = "c" Then
  283.     MsgBox "There are no settings for this screen saver." & vbCrLf & vbCrLf & "Michael Toye" & vbCrLf & "michael_toye@yahoo.co.uk", vbInformation, "Dotty Starfield"
  284.     End
  285. End If
  286. Randomize Timer
  287.  
  288. bBUILDMODE = True
  289.  
  290. If Not bBUILDMODE Then
  291.     Set CMM = New cMonitors
  292.     scrL = CMM.VirtualScreenLeft
  293.     scrT = CMM.VirtualScreenTop
  294.     scrW = CMM.VirtualScreenWidth
  295.     scrH = CMM.VirtualScreenHeight
  296. Else
  297.     scrL = 0
  298.     scrT = 0
  299.     scrW = Me.Width \ Screen.TwipsPerPixelX
  300.     scrH = Me.Height \ Screen.TwipsPerPixelY
  301. End If
  302. scrR = scrW - scrL
  303. scrB = scrH - scrT
  304. midX = scrL + (scrW / 2)
  305. midY = scrT + (scrH / 2)
  306.  
  307. CreateDIB mBlankDIB, scrW, scrH
  308. CreateDIB mBufferDIB, scrW, scrH
  309.  
  310. SetupStars
  311.  
  312. Timer1.Enabled = True
  313. End Sub
  314.  
  315. Sub SetTopmostWindow(ByVal hwnd As Long, Optional topmost As Boolean = True)
  316.     Const HWND_NOTOPMOST = -2
  317.     Const HWND_TOPMOST = -1
  318.     Const SWP_NOMOVE = &H2
  319.     Const SWP_NOSIZE = &H1
  320.     SetWindowPos hwnd, IIf(topmost, HWND_TOPMOST, HWND_NOTOPMOST), 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
  321. End Sub
  322.  
  323. Function GimmeX(ByVal aIn As Single, lIn As Long) As Long
  324. '(pi/180)
  325.     GimmeX = sIN(aIn * 0.01745329251994) * lIn
  326.  
  327. End Function
  328. Function GimmeY(ByVal aIn As Single, lIn As Long) As Long
  329. '(pi/180)
  330.     GimmeY = Cos(aIn * 0.01745329251994) * lIn
  331. End Function
  332. Function Sine(Degrees_Arg)
  333. 'Atn(1) / 45
  334. Sine = sIN(Degrees_Arg * 0.01745329251994)
  335. End Function
  336.  
  337. Function Cosine(Degrees_Arg)
  338. 'Atn(1) / 45
  339. Cosine = Cos(Degrees_Arg * 0.01745329251994)
  340. End Function
  341. Private Sub Form_KeyPress(KeyAscii As Integer)
  342.     bStop = True
  343. End Sub
  344.  
  345. Private Sub COUT(sIN$, x&, y&)
  346.  
  347.     SetTextColor mBufferDIB.hDC, RGB(50, 50, 50)
  348.     TextOut mBufferDIB.hDC, x, y, sIN, Len(sIN)
  349.  
  350. End Sub
  351. Private Sub CreateDIB(ByRef tDIB As cDIBSection, scrW&, scrH&)
  352. Set tDIB = New cDIBSection
  353. With tDIB
  354.     .Create scrW, scrH
  355.     SetBkMode .hDC, TRANSPARENT
  356.     SetFont .hDC, "Tahoma", 8
  357. End With
  358. End Sub
  359.  
  360. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  361. Static X0 As Integer, Y0 As Integer
  362.     If Not bBUILDMODE Then
  363.         If ((X0 = 0) And (Y0 = 0)) Or _
  364.            ((Abs(X0 - x) < 8) And (Abs(Y0 - y) < 8)) Then ' small mouse movement...
  365.             X0 = x                          ' Save current x coordinate
  366.             Y0 = y                          ' Save current y coordinate
  367.             Exit Sub                        ' Exit
  368.         End If
  369.         bStop = True
  370.     End If
  371.  
  372. End Sub
  373.  
  374. Private Sub Form_Unload(Cancel As Integer)
  375.     Set mBlankDIB = Nothing
  376.     Set mBufferDIB = Nothing
  377.  
  378.     Set CMM = Nothing
  379.     ShowCursor -1
  380.     Screen.MousePointer = vbDefault
  381. End Sub
  382. Sub SetupStars()
  383. Dim n&, st&
  384.     ReDim uStars(20)
  385.     For n = 0 To UBound(uStars)
  386.         With uStars(n)
  387.             .a = Int(Rnd * 360)
  388.             st = Int(Rnd * scrW * 0.2)
  389.             .x = midX + GimmeX(.a, st)
  390.             .y = midY + GimmeY(.a, st)
  391.             .r = 10
  392.             .q = Int(Rnd * 360)
  393.             .w = Int(Rnd * 360)
  394.             .spd = 2 + Int(Rnd * 40)
  395.             .qi = (1 + Int(Rnd * 5)) * IIf((Rnd * 1000) > 600, -1, 1)
  396.             .wi = (1 + Int(Rnd * 5)) * IIf((Rnd * 1000) > 600, -1, 1)
  397.             .offScreen = 0
  398.         End With
  399.     Next
  400. End Sub
  401. Private Sub Timer1_Timer()
  402.     Timer1.Enabled = False
  403.     DoEvents
  404.     
  405.     If Me.WindowState = 1 Then Me.WindowState = 0
  406.     
  407.     If Not bBUILDMODE Then
  408.         Me.Move scrL * Screen.TwipsPerPixelX, scrT * Screen.TwipsPerPixelY, scrW * Screen.TwipsPerPixelX, scrH * Screen.TwipsPerPixelY
  409.         SetTopmostWindow Me.hwnd
  410.         ShowCursor 0
  411.     Else
  412.         Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - (Me.Height * 1.2))
  413.     End If
  414.  
  415.     
  416.  
  417.     DisplaySS
  418. End Sub
  419.  
  420. Private Sub DisplaySS()
  421.  
  422. Dim n&, s&, st&, t&, f&, fp&, ag!
  423. 't = GetTickCount: f = 0 'reinstate for FPS
  424.     Do
  425.         
  426.         BitBlt mBufferDIB.hDC, scrL, scrT, scrW, scrH, mBlankDIB.hDC, 0, 0, vbSrcCopy
  427.         'ApplyBlend
  428.         
  429.         
  430.         'reinstate for FPS  -->
  431. '        f = f + 1
  432. '        If GetTickCount - t >= 1000 Then
  433. '            t = GetTickCount: fp = f: f = 0
  434. '        End If
  435. '        COUT CStr(fp), 3, 3
  436.         '<-- reinstate for FPS
  437.         
  438.         For n = 0 To UBound(uStars)
  439.             With uStars(n)
  440.                 PlotBall mBufferDIB.hDC, .x, .y, .r, .q, .w, .offScreen
  441.             End With
  442.         Next
  443.         BitBlt Me.hDC, scrL, scrT, scrW, scrH, mBufferDIB.hDC, 0, 0, vbSrcCopy
  444.         
  445.         For n = 0 To UBound(uStars)
  446.             With uStars(n)
  447.                 .q = .q + .qi
  448.                 If .q > 360 Then .q = .q - 360
  449.                 If .q < 0 Then .q = .q + 360
  450.                 .w = .w + .wi
  451.                 If .w > 360 Then .w = .w - 360
  452.                 If .w < 0 Then .w = .w + 360
  453.                 ag = .a * 0.01745329251994
  454.                 .x = .x + (sIN(ag) * .spd)
  455.                 .y = .y + (Cos(ag) * .spd)
  456.                  .r = .r + 1
  457.                 If .offScreen = 1 Then
  458.                     .a = Int(Rnd * 360)
  459.                     ag = .a * 0.01745329251994
  460.                                         ' Save current y cooi uStfDfbSEIx3            l2oYra25151994)
  461. r .a = DUnderline As Boolean, ByVCan As Long, ByVal fnWeight.fDfbSEIx3   Cosine = Cos(aecr2 If .w <-= Cos(aecr2 If .2 If IurrenfbSEsi
  462.  y cx3(n2M (n2M (n2M (n2M (n2M (n2M (n22M (n2rW,x)M (n2M LsIM.w + .wi
  463.                        .a = Int(Rnd * 360)
  464.               DFIf((Rnd * 100 
  465.               DFIf((Rnd * 100 
  466.               DFIf((R
  467.                hen.Width          DFIf((Rnd * 100 
  468.            DFIf((R
  469.           e Su
  470.  q59R
  471.        es_Arg * 0.0en.Width          DFIf((Rndliseco" 100 
  472.         idth   Of 1  6    t =        
  473.                   D
  474. S9R
  475.         es_Arg * 0   4H 4H DFIf((Rnd * o50,(Rndlise ,
  476. Function y50,,Rnd * 100 
  477.            DFIf((R
  478.           e Su
  479.  q59R
  480.        es_Arg * 0.0en.WI&ThS    e Su
  481.  q59R
  482.        es     COUT CStr(fp), 3, 3
  483. es     Cr(fp), 3, 32M (n2M (n22M (n2rW,x)M (n2M LsIM.w + .wilv,1   0en. CStr(fp),me2M (n2en. C  WithxH5, 3, 3
  484. es     Cr(fp), 3, 32M (n2M (n22M (n2rW,x)OGHRM (n2rW,x)M (n2M LsIM.w + .wi    4H 4H DF
  485. 'th22M (n2rW,xeelX, s (n2r(fp), 3, 3g
  486. E(With uStars(n)
  487. lC, 0
  488. lC, 0
  489. lc 4H 4H DFy (n2M LC, 0
  490. lc 4H 4H DFy (n, 3, 32M (nA1  6    rW,x)M (nr
  491.       o     _Toole e_      NenkDIB.hDC, 0, 0, vb NenkDIB.hDC, 0, 0, vb Nma          ag = .a * 0.0,laO          H2eR = .a *nFag       r .  H2eR = .a *nFag       r .  O
  492. es     End With
  493.         Nexi)0, 0T 122Mc 4H 4H DFyCind With
  494.         NexRO
  495. esscrW)           aT   aT   aT   aT   aT  aT   aT   aT   a   aT   aT  aT   aT   aT   a  0 3,  0 3,i               4H 4H ion y50    22Mcc&  a  0 3, a  0 3,  0 3,i   0hu0Da-tgDoo aT*yCind With
  496.         NpsPerPixelObzayf*.n2M LsIM.w + BerPixOerPixOe .a * 0.0,laO  aT   a   aT   aT  aT   aT   PixOe .a * 0fh
  497. llTnoc Oe .  aT       vate Type GUID
  498.    Data1 Oe 
  499.              MriSfIDsSeg
  500. E(WitCos(aST   aRlB(WitCHh
  501.         Nps(rb = (cl   
  502.     FoxMppb =  ykiSfID.  O
  503. eLLUID
  504.   B(WitCHh
  505.     e eg  = 0, 0Rriva0fh
  506. llTnoc Oe .  riva    FoxMppb     
  507.     e   3eSe(n2en. C  T   Sr HerPixelYz(e'b = (cl   
  508.  , 0Rriva0fh
  509. 4 q59R
  510.        es     COUT CStr(fp), 3, 3T CStx COUT CStr(fp)iN