TGC Codebase Backup



Text to image by Brux

26th Nov 2014 8:58
Summary

Text to image turns any text in an image



Description

turns any text in an image
colors and sizes that most 'you like
uses a character or number to your liking
max size x = 8
max size y = 8
minimun X=4
minimun y=4



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Rem *************************************
Rem *         TEXT TO IMAGE             *
Rem *                                   *
Rem *       By Ermamno (Italy)          *
Rem *           (Brux)                  *
Rem *    e-mail: me52@libero.it         *
Rem *************************************


rem define some colors
white=rgb(255,255,255)
red=rgb(255,0,0)
green=rgb(111,141,16)

valx=4
valy=4

main:
posx=0:posy=0:w=0
ink white,0
create bitmap 1,640,480
create bitmap 2,640,480
rem Type your text here
rem choose color that you like

text 1,1,"TEXT"
ink green,0
text 1,12,"TO IMAGE"
text 1,23,"BY ERMANNO"
ink red,0
text 1,35,"I T A L Y "

for y=1 to 60
 for x=1 to 120
  set current bitmap 2
  c=POINT(x,y)
  r=rgbr(c)
  g=rgbg(c)
  b=rgbb(c)
  set current bitmap 1
rem draw on bitmap 1
  ink rgb(r,g,b),0
   if r>0 or g>0 or b>0
rem choose a font that you like
    text 1+posx,10+posy,"@"
   endif
   inc posx,valx
 next x
posx=0
inc posy,valy
next y
delete bitmap 2
rem et voila' **************** et voila'
copy bitmap 1,0
delete bitmap 1
set current bitmap 0
scritta(white,valx,valy)
repeat
 k$=inkey$()
 jasc=asc(k$)
until k$>""

rem text 100,300,str$(jasc)
rem pause the program from running until a key is pressed
repeat:until inkey$()=""


rem Save and finish
if jasc=115
 get image 1,0,0,639,440
 save image "filename.jpg",1
 wait 100
 cls
 end
endif

rem +
if jasc=120
 inc valx
endif
rem -
if jasc=121
 inc valy
endif

if valx>8 then valx=4
if valy>8 then valy=4

goto main
end

function scritta(white,valx,valy)
ink white,0
text 50,460,"S=[Save Image]  X [Change Value X]  Y [Change Value Y]  X="+str$(valx)+" Y="+str$(valy)
endfunction