Results 1 to 3 of 3
-
19th Jun 2010, 06:06 PM #1OPMember
Tutorials: Creating Images with PHP
The fundamentals of creating an image in PHP using GD Library support. This tutorial shows you how to create a simple image with welcome text and a name to follow.
Cooper Reviewed by Cooper on . Tutorials: Creating Images with PHP The fundamentals of creating an image in PHP using GD Library support. This tutorial shows you how to create a simple image with welcome text and a name to follow. YGHL5i0Fnnw Rating: 5Removed by staff. Do not add the image again or we may infract you. We do not condone members to create protests.But But But what about freedom of speech. <-- that's a myth that exists in developed countries.
-
19th Jun 2010, 06:32 PM #2Respected DeveloperWebsite's:
wrzc.orgI made this for Hawk a few months ago. Some may find it useful
PHP Code:<?php
/*
Download for instructions and how to use...
http://rapidshare.com/files/400777995/php-image.zip
*/
// lets get the text to display
if (isset($_GET['id'])) {
$text = $_GET['id'];
}
// here you can put the default message if their's an error displaying the one in the url.
else { $text = "Default message here";}
// This is the default background image. Like a template without the text showing on it.
$bg = "bg/default.jpg";
// obvious enough. Change the size. It's height is in pixels.
$size = "30";
// just enter the hex color you want. You can use something like http://www.2createawebsite.com/build/hex-colors.html to get the color you want.
$color = "A03B3B";
// change the path to where you upload the font. It has to be .ttf but you can google and find which ever suits.
$font = "font/arial.ttf";
$im = imagecreatefromjpeg($bg);
Header("Content-type: image/png");
// This convert the hex color to RGB
$color = imagecolorallocate($im, hexdec('0x' . $color{0} . $color{1}), hexdec('0x' . $color{2} . $color{3}), hexdec('0x' . $color{4} . $color{5}));
//------ this is a fancy bit you can use if you want the text centered --------
for(;;){
// just change the figures below to where you want the exact center point of the text to be from the top left corner
$image_width = '400';
$image_height = '62';
list($left_x, $bottom_y, $right_x, , , $top_y) = imagettfbbox($size, 0, $font, $text);
$text_width = $right_x - $left_x;
$text_height = $top_y - $bottom_y;
if($image_width > $text_width+5){
break;
}
$size = $size - .5;
if($size == 1){
die('Script not responding to decreasing font size, in other words: try using less letters.');
}
}
$hpadding = ($image_width - $text_width)/2;
$vpadding = ($image_height - $text_height)/2;
//-------- End of fancy centered text bit, Delete it all if you don't want it --------
// If you not using and have deleted the fancy centered bit above you can uncomment the below two lines to put where you want to give the location of the text.
// $hpadding = '200';
// $vpadding = '100';
// Next we add the text
// FORMAT IS: image, size, angle, x distance, y distance, color, font, text string
imagettftext($im, $size, 0, $hpadding, $vpadding, $color, $font, $text);
imagepng($im);
imagedestroy($im);
?>
Download it all here http://rapidshare.com/files/400777995/php-image.zipTutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
20th Jun 2010, 12:30 PM #3MemberWebsite's:
litewarez.net litewarez.com triniwarez.comHate people who use for(;{ lool use while(true){
Nice little post tho MrHJoin Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Broken Images overlapping New Images
By Leeds in forum vBulletinReplies: 8Last Post: 17th Apr 2012, 08:57 PM -
SEO Tutorials - Tutorials for new webmasters
By Profit in forum Tutorials and GuidesReplies: 16Last Post: 9th Dec 2011, 06:52 AM -
Free images host uploader - images will not expire!
By jippo in forum Useful SitesReplies: 11Last Post: 11th Feb 2011, 11:58 PM -
Creating forum signature tutorials?
By Daniel in forum Graphics AreaReplies: 14Last Post: 29th Sep 2010, 11:50 PM -
Images Watermarker of my Images and Upload it!!
By Bytes in forum Completed TransactionsReplies: 11Last Post: 5th Aug 2010, 11:24 AM
themaManager - edit and manage...
Version 4.04 released. Open older version (or...