reset and begin
7/21/2010

tạo chữ trên ảnh với php text over(on) image in php

<?php

//PHP's GD class functions can create a variety of output image
//types, this example creates a jpeg
header("Content-Type: image/jpeg");

//open up the image you want to put text over
$im = imagecreatefromgif("a.gif");

//The numbers are the RGB values of the color you want to use
$black = imagecolorallocate($im, 24, 55, 55);
$x = imagesx($im);
$y = imagesy($im);
//The canvas's (0,0) position is the upper left corner
//So this is how far down and to the right the text should start
$start_x = 0;
$start_y = $y-16;

//This writes your text on the image in 12 point using verdana.ttf
//For the type of effects you quoted, you'll want to use a truetype font
//And not one of GD's built in fonts. Just upload the ttf file from your
//c: windows fonts directory to your web server to use it.
imagettftext($im, 16, 0, $start_x, $start_y, $black, 'f.ttf', "HTTP://DOCNHAT.TK  ");

//Creates the jpeg image and sends it to the browser
//100 is the jpeg quality percentage
imagejpeg($im,'', 100);

imagedestroy($im);

?>

Bloger Comments
G+ Comments
Comments FaceBook

No comments:

List

Profiles Information


About me : Nothing is 1 vài thứ - 1985

Places I've Lived : I Hà Nội

Home Page : http://www.shimivn.blogspot.com/

Think : 1:1000000000

Languages spoken : Vietnamese,English.

Mobile : sony C2305

dell : i3-Ram 3GB- HDD 250GB .