11-01-2024, 03:23 AM
A simple routine to print a square text of any size font to the screen, as per Phil's request here: https://qb64phoenix.com/forum/showthread.php?tid=3182
Code: (Select All)
$Color:32
Screen _NewImage(640, 480, 32)
Color Orange, Blue
SquarePrint 0, 0, 8, "Hello World"
Color Red, Green
Sleep
SquarePrint 8, 8, 32, "Hello World"
Color Blue, Yellow
Sleep
SquarePrint 100, 100, 32, "Testing the code!"
Sleep
System
Sub SquarePrint (x, y, size As Single, text$)
Dim As _Unsigned Long dc, bg
If size < 4 Or size > 256 Then Exit Sub
sz = size / 8
tempscreen = _NewImage(_Width / size * 8, _Height / size * 8, 32)
d = _Dest: dc = _DefaultColor: bg = _BackgroundColor
_Dest tempscreen
Color dc, bg: _Font 8
_PrintString (x * 8 / size, y * 8 / size), text$
_Dest d
_PutImage , tempscreen
_FreeImage tempscreen
End Sub