Was nötig um Tutorials zu schreiben?

Eagle-PsyX-

Erfahrenes Mitglied
Hi, ich hab grad versucht ein Tutorial (PHP - Codeschnippsel) zu schreiben aber ich hab keine Rechte? Was ist dafür notwendig?

Hier dennoch der Code, vlt. schreibt ihn jemand von euch (für mich)^^

Dynamischer Ladebalken:
Ladebalken 1
Ladebalken 2
PHP:
<?
//Image Size:
$Width =  $_GET[W];
$Hight = $_GET[H];

$FilenameBG = 'bg.jpg';
$FilenameFG = 'fg.jpg';

$Font = "arialf";
$FontSize = $Hight / 3;
$FontPositionX = $Width / 2 - 4 * imagefontwidth($Font);
$FontPositionY = $Hight - (($Hight - $FontSize) / 2);

$BGColor = HEX_RGB($_GET[B]); //Background Color:
$CColor = HEX_RGB($_GET[ C]); //Font Color:
$FGColor = HEX_RGB($_GET[F]); //Foreground Color:

header('Content-Type: image/gif',true); //header wird verschickt

$img = imagecreatetruecolor($Width, $Hight); 
$FillWidth = $Width/100 * $_GET[P];

$col = imagecolorallocate($img, $BGColor[0],$BGColor[1],$BGColor[2]); 
$col2 = imagecolorallocate($img, $FGColor[0],$FGColor[1],$FGColor[2]);
$col3 = imagecolorallocate($img, $CColor[0],$CColor[1],$CColor[2]);


imagefill($img, 0, 0, $col);  //Hintergrund wird gefüllt
if ($_GET[L] == 1) {
	$ImageBG = imagecreatefromjpeg($FilenameBG);
	list($width_origBG, $height_origBG) = getimagesize($FilenameBG);
	imagecopyresampled($img, $ImageBG, 0, 0, 0, 0, $Width, $Hight, $width_origBG, $height_origBG);
}
imagefilledrectangle($img,0,0,$FillWidth,$Hight,$col2); //Vordergrund
if ($_GET[L] == 1) {
	$ImageFG = imagecreatefromjpeg($FilenameFG);
	list($width_origFG, $height_origFG) = getimagesize($FilenameFG);
	imagecopyresampled($img, $ImageFG, 0, 0, 0, 0, $FillWidth+1, $Hight, $width_origFG, $height_origFG);
}
if ($_GET[R] == 1)
{
imagefilledrectangle($img,0,0,$Width,1,$col2); //Rand
imagefilledrectangle($img,$Width ,0,$Width-1,$Hight,$col2); //Rand
imagefilledrectangle($img,0,$Hight-2,$Width,$Hight,$col2); //Rand
imagefilledrectangle($img,0,0,1,$Hight,$col2); //Rand
}

imagettftext($img, $FontSize, 0, $FontPositionX, $FontPositionY, $col3, $Font, $_GET[P] . " %");

imagegif($img); // Ausgabe des Bildes an den Browser 
imagedestroy($img); // Freigeben von Speicher 

function HEX_RGB($var) //Funktion die aus dem HEX Farben einen RBG Farbenwert herausgibt (als Array)
	{
		$var = "#" . $var;
		$var = (sscanf($var, '#%2x%2x%2x'));
		return $var;
	}
?>
 
Einfach in die "Tutorials Inbox" damit und dann schaltet ein Moderator es frei, wenn es als passend angesehen wird ;)
 

Neue Beiträge

Zurück