Escolar Documentos
Profissional Documentos
Cultura Documentos
Option Explicit
Private Declare Function GetClientRect Lib "user32.dll" (ByVal hwnd As Long, lpRect As
RECT) As Long
Private Declare Function ByteOut Lib "gdi32.dll" Alias "TextOutA" (ByVal hDC As Long,
ByVal X As Long, ByVal Y As Long, lpString As Byte, ByVal nCount As Long) As Long
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Dim R As RECT
Dim bQuit As Boolean
Dim bRunning As Boolean
GetClientRect Picture1.hwnd, R
'Call InitBackground
Me.Show
Call InitText(Page)
Dim C As Long
Dim CharsDone As Long
Dim T As Long
Dim bReverse As Boolean
Dim tmp As POINT
bRunning = True
DoEvents
Sleep 300
Do
T = timeGetTime
Picture1.Cls
For C = 0 To CharsUB
With Chars(C)
If .bReady = False Then
.Pos.X = .Pos.X + .v
.Pos.Y = .Pos.Y + .v * .m
End If
Picture1.ForeColor = .Color
Picture1.FontBold = .Bold
Picture1.FontUnderline = .Bold
End With
Next
Picture1.Refresh
Do
'If GetInputState Then
DoEvents
Loop Until timeGetTime - T > 3
T = GetText(Page)
ColorMap = GetColorMap()
TextW = Picture1.TextWidth(T)
TextH = Picture1.TextHeight(T)
With TextRect
.Top = (R.Bottom - TextH) \ 2
.Left = (R.Right - TextW) \ 2
.Bottom = R.Top + TextH
.Right = R.Left + TextW
End With
Dim Y As Long
Dim X As Long
Dim W As Long
Dim Color As Long
TextH = Picture1.TextHeight("Q")
X = TextRect.Left
Y = TextRect.Top
For W = 1 To Len(T)
C = Mid$(T, W, 1)
If C <> vbLf Then
With Chars(Char)
.C = Asc(C)
.Target.X = X
.Target.Y = Y
TextW = Picture1.TextWidth(C)
Do
Loop Until (.Start.X + TextW < R.Left Or .Start.X > R.Right) And _
(.Start.Y + TextH < R.Top Or .Start.Y > R.Bottom)
.Pos = .Start
.v = 5
If .Start.X > .Target.X Then .v = -.v
.Color = ColorMap(Line)
.Bold = Line = 0
End With
X = X + TextW
Char = Char + 1
Else
Y = Y + TextH
X = TextRect.Left
Line = Line + 1
End If
Next
End Sub
Case 2
GetText = "Warranty" & vbCrLf & _
vbCrLf & _
"This program has been tested and" & vbCrLf & _
"seems to run stable." & vbCrLf & _
"However, i can not guarantee that this" & vbCrLf & _
"Software is bugfree." & vbCrLf & _
"You use this software of your own risk." & vbCrLf & _
"This Software is provided ""as it is"" without" & vbCrLf & _
"any warranty. " & vbCrLf & _
vbCrLf & _
"If you have problems or suggestions just" & vbCrLf & _
"Mail me.mello"
End Select
End Function
C(2) = &HC0FF00
C(3) = &HFFFF&
C(6) = &H8080FF
C(7) = &HFF00&
C(8) = &HAA00AA
C(13) = &HAA00AA
GetColorMap = C
End Function