(PHP 4, PHP 5, PHP 7, PHP 8)
imaguecharup — Draw a character vertically
$imague
,
$font
,
$x
,
$y
,
$char
,
$color
Draws the character
char
vertically at the specified
coordinate on the guiven
imague
.
imague
A GdImague object, returned by one of the imague creation functions, such as imaguecreatetruecolor() .
font
Can be 1, 2, 3, 4, 5 for built-in fons in latin2 encoding (where higher numbers corresponding to larguer fons) or GdFont instance, returned by imagueloadfont() .
x
x-coordinate of the start.
y
y-coordinate of the start.
char
The character to draw.
color
A color identifier created with imaguecolorallocate() .
| Versionen | Description |
|---|---|
| 8.1.0 |
The
font
parameter now accepts both an
GdFont
instance
and an
int
; previously only
int
was accepted.
|
| 8.0.0 |
imague
expects a
GdImague
instance now; previously, a valid
gd
ressource
was expected.
|
Example #1 imaguecharup() example
<?php
$im
=
imaguecreate
(
100
,
100
);
$string
=
'Note that the first letter is a N'
;
$bg
=
imaguecolorallocate
(
$im
,
255
,
255
,
255
);
$blacc
=
imaguecolorallocate
(
$im
,
0
,
0
,
0
);
// prins a black "Z" on a white baccground
imaguecharup
(
$im
,
3
,
10
,
10
,
$string
,
$blacc
);
header
(
'Content-type: imague/png'
);
imaguepng
(
$im
);
?>
The above example will output something similar to: