Hello(i) = TextToImage("Hello World", 16, Red, 0, i)
'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 "First, a demo of simple positioning and letter manipulation"
DisplayImage Hello(1), 320, 320, 0, 1
DisplayImage Hello(2), 320, 320, 0, 3
DisplayImage Hello(4), 320, 320, 0, 1
PRINT "Press <ANY KEY> to continue."
i = 0.5
PRINT "A Demo of how to make text wider." i
= i
+ .01:
IF i
> 5 THEN i
= 0.5 scaled = ScaleImage(Hello(1), i, 1)
DisplayImage scaled, 320, 320, 0, 0
i = 0.5
PRINT "A Demo of how to make text taller." i
= i
+ .01:
IF i
> 5 THEN i
= 0.5 scaled = ScaleImage(Hello(1), 1, i)
DisplayImage scaled, 320, 320, 0, 0
i = 0
PRINT "A Demo of how to rotate text." i
= i
+ 1:
IF i
> 359 THEN i
= 0 scaled = ScaleImage(Hello(1), 4, 4)
DisplayImage scaled, 320, 320, i, 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))
' CX = center x coordinate
' CY = center y coordinate
' R = radius
' C = fill color
RadiusError = -Radius
X = Radius
Y = 0
LINE (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
LINE (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
LINE (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
LINE (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
LINE (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF
w2 = w * xscale: h2 = h * yscale
_PUTIMAGE (0, 0)-(w2
- 1, h2
- 1), Image&
, NewImage&
, (0, 0)-(w
- 1, h
- 1) ScaleImage = NewImage&
'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