Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question<?php $companyName = isset($_GET["companyName"]) ? $_GET["companyName"] : "" ; $companySlogan = isset($_GET["companySlogan"]) ? $_GET["companySlogan"] : "" ; $fullName = isset($_GET["fullName"]) ? $_GET["fullName"] : "" ; $jobTitle = isset($_GET["jobTitle"]) ? $_GET["jobTitle"] : "" ; $businessAddress = isset($_GET["businessAddress"]) ? $_GET["businessAddress"] : "" ; $businessAddress = str_replace("\\n","\n",$businessAddress); $businessAddress = str_replace("\","",$businessAddress); $phoneOne = isset($_GET["phoneOne"]) ? $_GET["phoneOne"] : "" ; $phoneTwo = isset($_GET["phoneTwo"]) ? $_GET["phoneTwo"] : "" ; $emailAddress = isset($_GET["emailAddress"]) ? $_GET["emailAddress"] : "" ; $siteUrl = isset($_GET["siteUrl"]) ? $_GET["siteUrl"] : "" ; header("Content-type: image/png"); $handle = imagecreatefrompng( 'template.png' ); $brown = ImageColorAllocate ($handle, 84, 48, 26); $lightBrown = ImageColorAllocate ($handle, 145, 116, 94); $white = ImageColorAllocate ($handle, 255, 255, 255); $peach = ImageColorAllocate ($handle, 238, 222, 200); //company name ImageTTFText ($handle, 18, 0, 20, 35, $brown, "timesbd.ttf", $companyName); //company slogan ImageTTFText ($handle, 9, 0, 20, 50, $lightBrown, "GOTHIC.TTF", $companySlogan); //full name ImageTTFText ($handle, 14, 0, 20, 110, $white, "times.ttf", $fullName); //job title ImageTTFText ($handle, 9, 0, 19, 122, $peach, "GOTHIC.TTF", $jobTitle); //business address ImageTTFText ($handle, 10, 0, 20, 160, $brown, "GOTHIC.TTF", $businessAddress); //phone number #1 ImageTTFText ($handle, 9, 0, 317, 160, $brown, "GOTHIC.TTF", $phoneOne); //phone number #2 ImageTTFText ($handle, 9, 0, 317, 175, $brown, "GOTHIC.TTF", $phoneTwo); //email address ImageTTFText ($handle, 9, 0, 275, 190, $brown, "GOTHIC.TTF", $emailAddress); //site url (exmple of how to center copy) $fontSize = "12"; $width = "420"; $textWidth = $fontSize * strlen($siteUrl); $position_center = $width / 2 - $textWidth / 2.6; ImageTTFText ($handle, $fontSize, 0, $position_center, 240, $brown, "GOTHICB.TTF", $siteUrl); imagealphablending( $handle, false ); imagesavealpha( $handle, true ); ImagePng ($handle); imagedestroy( $handle ); ?>