first we bring the photo
using imagecreatefromjpeg
also there is anthor function for gif,png,bmp
this para contain the string wht we want to write
here we locate the color RGB
this function to write the strings on
the pic we use $black to define th color
5->font type"built in GDlibrary also(0,1,2,3,4,5)"
0,0->X,Y Axis
$im->pic
header: type of picture JPEG
finally the
OUT PUT
The complete code
ithink its simple and important for pic gallery site ?
Regards XXcoderz
Last edited by XXcoderz on Wed Feb 21, 2007 8:09 pm; edited 1 time in total
using imagecreatefromjpeg
also there is anthor function for gif,png,bmp
| Code: |
| $im=imagecreatefromjpeg("sunset.jpg"); |
this para contain the string wht we want to write
| Code: |
| $string="fri host "; |
here we locate the color RGB
| Code: |
| $black = imagecolorallocate($im, 0, 0, 0); |
this function to write the strings on
the pic we use $black to define th color
5->font type"built in GDlibrary also(0,1,2,3,4,5)"
0,0->X,Y Axis
$im->pic
| Code: |
| imagestring($im, 5, 0, 0, $string, $black); |
header: type of picture JPEG
| Code: |
| header('Content-type: image/jpeg'); |
finally the
OUT PUT
| Code: |
| imagejpeg($im); |
The complete code
| Code: |
| <?
$im=imagecreatefromjpeg("sunset.jpg"); $string="fri host "; $black = imagecolorallocate($im, 0, 0, 0); imagestring($im, 16, 0, 0, $string, $black); header('Content-type: image/jpeg'); imagejpeg($im); ?> |
ithink its simple and important for pic gallery site ?
Regards XXcoderz
Last edited by XXcoderz on Wed Feb 21, 2007 8:09 pm; edited 1 time in total
