Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple text pixel data to array demo
#3
OK that was done using _PutImage, many ways to skin a cat!

Here is what can be done by saving pixels to an array:
Code: (Select All)
_Title "WELCOME"
Randomize Timer
Const xmax = 1200
Const ymax = 600

_Define A-Z As INTEGER
Common Shared cN, pR!, pG!, pB!

Screen _NewImage(xmax, ymax, 32)
mess$ = " Amazing.bas how sweet thou art... "
Print mess$
w = 8 * Len(mess$): h = 16
Dim p(w, h)
black&& = Point(0, 10)
For y = 0 To h
    For x = 0 To w
        If Point(x, y) <> black&& Then
            p(x, y) = 1
        End If
    Next
Next

Cls
xo = 5: yo = 235: m = 4
resetPlasma
While 1
    For y = 0 To h - 1
        For x = 0 To w - 1
            If p(x, y) Then
                changePlasma
            Else
                Color 0
            End If
            Line (xo + x * m, yo + y * m)-(xo + x * m + m, yo + y * m + m), , BF
        Next
    Next
    _Limit 10
    lc = lc + 1
    If lc Mod 30 = 0 Then resetPlasma
Wend

Sub changePlasma ()
    cN = cN + 1
    Color _RGB(127 + 127 * Sin(pR! * .3 * cN), 127 + 127 * Sin(pG! * .3 * cN), 127 + 127 * Sin(pB! * .3 * cN))
End Sub

Sub resetPlasma ()
    pR! = Rnd ^ 2: pG! = Rnd ^ 2: pB! = Rnd ^ 2
End Sub

   

Once again QBJS fails to run a simple peice of code. @dbox I find you more to fix Smile QBJS can do POINT stuff I think. Did not like Common, God how old is this code? I was still using Common, replace with DIM Shared. DefInt was a problem too, commented out and just the plasma works but no points loaded in array???
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: Simple text pixel data to array demo - by bplus - 09-12-2025, 02:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  WinAPI Mouse Demo Pete 0 184 12-20-2025, 06:40 PM
Last Post: Pete
  Hyperlink Demo in SCREEN 0 Pete 2 362 11-02-2025, 07:13 PM
Last Post: madscijr
  Text Effects 2 2112 6 665 10-30-2025, 11:13 PM
Last Post: Unseen Machine
  Text Encryption-Decryption 2112 6 740 10-21-2025, 11:51 AM
Last Post: euklides
  Unique Random Array Program eoredson 5 822 07-10-2025, 10:29 AM
Last Post: DANILIN

Forum Jump:


Users browsing this thread: 1 Guest(s)