text = TextToImage("Steve is Awesome!", 16, &HFFFF0000, &HFFFFFF00, 0)
text2h = ScaleImage(text, 2, 1) 'twice as high
text2w = ScaleImage(text, 1, 2) 'twice as wide
text4 = ScaleImage(text, 4, 4) 'four times normal size
angle
= (angle
+ 1) MOD 360 DisplayImage text, 50, 50, 0, 1
DisplayImage text2h, 50, 100, 0, 1
DisplayImage text2w, 50, 150, 0, 1
DisplayImage text4, 400, 300, angle, 0
'Image is the image handle which we use to reference our image.
'x,y is the X/Y coordinates where we want the image to be at on the screen.
'angle is the angle which we wish to rotate the image.
'mode determines HOW we place the image at point X,Y.
'Mode 0 we center the image at point X,Y
'Mode 1 we place the Top Left corner of oour image at point X,Y
'Mode 2 is Bottom Left
'Mode 3 is Top Right
'Mode 4 is Bottom Right
px(0) = -w \ 2: py(0) = -h \ 2: px(3) = w \ 2: py(3) = -h \ 2
px(1) = -w \ 2: py(1) = h \ 2: px(2) = w \ 2: py(2) = h \ 2
px(0) = 0: py(0) = 0: px(3) = w: py(3) = 0
px(1) = 0: py(1) = h: px(2) = w: py(2) = h
px(0) = 0: py(0) = -h: px(3) = w: py(3) = -h
px(1) = 0: py(1) = 0: px(2) = w: py(2) = 0
px(0) = -w: py(0) = 0: px(3) = 0: py(3) = 0
px(1) = -w: py(1) = h: px(2) = 0: py(2) = h
px(0) = -w: py(0) = -h: px(3) = 0: py(3) = -h
px(1) = -w: py(1) = 0: px(2) = 0: py(2) = 0
sinr
= SIN(angle
/ 57.2957795131): cosr
= COS(angle
/ 57.2957795131) x2 = (px(i) * cosr + sinr * py(i)) + x: y2 = (py(i) * cosr - px(i) * sinr) + y
px(i) = x2: py(i) = y2
_MAPTRIANGLE (0, 0)-(0, h
- 1)-(w
- 1, h
- 1), Image
TO(px
(0), py
(0))-(px
(1), py
(1))-(px
(2), py
(2)) _MAPTRIANGLE (0, 0)-(w
- 1, 0)-(w
- 1, h
- 1), Image
TO(px
(0), py
(0))-(px
(3), py
(3))-(px
(2), py
(2))
'text$ is the text that we wish to transform into an image.
'font& is the handle of the font we want to use.
'fc& is the color of the font we want to use.
'bfc& is the background color of the font.
'Mode 1 is print forwards
'Mode 2 is print backwards
'Mode 3 is print from top to bottom
'Mode 4 is print from bottom up
'Mode 0 got lost somewhere, but it's OK. We check to see if our mode is < 1 or > 4 and compensate automatically if it is to make it one (default).
'print the text lengthwise
'print the text vertically
'Print text forward
'Print text backwards
temp$ = ""
temp$
= temp$
+ MID$(text$
, LEN(text$
) - i
, 1) 'Print text upwards
'first lets reverse the text, so it's easy to place
temp$ = ""
temp$
= temp$
+ MID$(text$
, LEN(text$
) - i
, 1) 'then put it where it belongs
fx
= (w&
- _PRINTWIDTH(MID$(temp$
, i
, 1))) / 2 + .99 'This is to center any non-monospaced letters so they look better 'Print text downwards
fx
= (w&
- _PRINTWIDTH(MID$(text$
, i
, 1))) / 2 + .99 'This is to center any non-monospaced letters so they look better
w2 = w * xscale: h2 = h * yscale
ScaleImage& = NewImage&