Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple text pixel data to array demo
#4
Yep @dbox something wrong with QBJS reading Black~& that sets all points to 1
Code: (Select All)
_Title "WELCOME"
Randomize Timer
Const xmax = 1200
Const ymax = 600

Dim 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) As Integer
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
For y = 0 To h
    For x = 0 To w
        Print p(x, y);
    Next
Next
Print
Sleep
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 5
    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
Again this test code works fine in QB64pe, modified to see what QBJS is doing with the p() array (nothing good) Smile

   
  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:47 AM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)