Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print + scroll text big to an image (is there a better way?)
#7
Thanks @bplus, i'll give that a look. 
Right away I see you are stretching the font with _PutImage, which would save me from having to use an array, but I'm getting an illegal function call. 
I'm out of time for today but can keep plugging away on it later. 
Thanks for posting that, I'll re-read it later.

Code: (Select All)
' display "hello" 2x bigger on screen

Dim img1 As Long
Dim ing2 As Long
Dim in2$
in2$ = "hello"
InitImage img1, _FontWidth * Len(in2$), _FontHeight, _RGB32(0, 0, 0)
InitImage img2, 1024, 768, _RGB32(0, 0, 0)

_Dest img1
Locate 1, 1
Color _RGB32(255, 0, 0), _RGB32(0, 0, 0)
Print "hello"

Screen img2: _ScreenMove 0, 0
_Dest img2

Dim sx1 As Integer, sy1 As Integer, sx2 As Integer, sy2 As Integer
sx1 = 1
sy1 = 1
sx2 = _Width(img1)
sy2 = _Height(img1)

Dim dx1 As Integer, dy1 As Integer, dx2 As Integer, dy2 As Integer
dx1 = 10
dy1 = 20
dx2 = _FontWidth * Len(in2$) * 2
dy2 = _FontHeight * 2

'_PUTIMAGE (dx1, dy1)-(dx2, dy2), sourceHandle&, destHandle&, (sx1, sy1) ' right side of source from top-left corner to destination

'THIS LINE FAILS WITH ILLEGAL FUNCTION CALL ERROR:
_PutImage (dx1, dy1)-(dx2, dy2), img1, img2, (sx1, sy1) '-(sx2, sy2)

Sleep

Screen 0

FreeImage img1
FreeImage img2

' /////////////////////////////////////////////////////////////////////////////

Sub InitImage (ThisImage&, iWidth&, iHeight&, bgColor~&)
    FreeImage ThisImage&
    ThisImage& = _NewImage(iWidth&, iHeight&, 32)
    _Dest ThisImage&: Cls , bgColor~&
End Sub ' InitImage

' /////////////////////////////////////////////////////////////////////////////

Sub FreeImage (ThisImage&)
    If ThisImage& < -1 Or ThisImage& > 0 Then _FreeImage ThisImage&
End Sub ' FreeImage


' _PUTIMAGE - QB64 Phoenix Edition Wiki
' https://qb64phoenix.com/qb64wiki/index.php/PUTIMAGE

' _PUTIMAGE (dx1, dy1)-(dx2, dy2), sourceHandle&, destHandle&,(sx1, sy1) 'right side of source from top-left corner to destination

' DAY 009:_PutImage
' https://qb64phoenix.com/forum/showthread.php?pid=9827
Reply


Messages In This Thread
RE: print + scroll text big to an image (is there a better way?) - by madscijr - 03-25-2025, 08:31 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,435 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)