Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print + scroll text big to an image (is there a better way?)
#8
My quick little thing - use _PutImage to enlarge the text, if you use a font other than MonoSpace, you will have to set the height and width of the font yourself according to the given font size (by estimation or calculation or otherwise), you can also zoom in on each character extra, but here I would really solve it with an array. Use the mouse wheel in the program, it's just a quick code that is far from perfect.

Code: (Select All)

font = _LoadFont("arial.ttf", 40, "monospace")
text$ = "test"

virtual = _NewImage(_FontWidth(font) * Len(text), _FontHeight(font), 32)
_Font font, virtual
_PrintString (0, 0), text$, virtual

Screen _NewImage(1080, 1050, 32)
Do Until I$ = Chr$(27)
    I$ = InKey$
    Do While _MouseInput
        zoom = zoom + _MouseWheel / 10
    Loop
    Cls
    Z virtual, _MouseX, _MouseY, zoom
    _Display
    _Limit 20
Loop

Sub Z (image, x, y, zoom)
    w = _Width(image)
    h = _Height(image)
    _PutImage (x, y)-(x + w * zoom, y + w * zoom), image, 0
End Sub


Reply


Messages In This Thread
RE: print + scroll text big to an image (is there a better way?) - by Petr - 03-25-2025, 08:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  3D Text SMcNeill 13 751 02-10-2026, 08:17 AM
Last Post: Unseen Machine
  Screw Peek-a-boo. Write on a hardware image form. Pete 0 457 04-08-2025, 11:28 PM
Last Post: Pete
  ImageGrid (combine multiple image files into one giant poster) madscijr 2 746 12-17-2024, 03:59 AM
Last Post: madscijr
  Text Previewer (windows only) SMcNeill 14 2,437 03-25-2024, 02:34 PM
Last Post: SMcNeill
  Minimal Text Animator James D Jarvis 5 1,134 09-16-2022, 07:12 PM
Last Post: James D Jarvis

Forum Jump:


Users browsing this thread: 1 Guest(s)