Hallo zusammen..
Ich habe Probleme beim abspeichern von Dynamisch erzeugten Bildern.
Ich habe eine kleine Funktion geschrieben:
	
die wird ca. so angewendet:
	
Also da werden eigendlich einfach kleine Bilder auf den hintergrund kopiert. Wen ich das Bild aber speichern möchte (als wenn ich den 2. Parameter von imagePNG() verwende) kommt ne Fehlermeldung:
Ne 500er
http://www.habboboard.ch/avamaker/te...la&type=schnee
Währe foroh wen du helfen könntest 
							
						
					Ich habe Probleme beim abspeichern von Dynamisch erzeugten Bildern.
Ich habe eine kleine Funktion geschrieben:
PHP-Code:
	
	
function get_ava($bg, $img)
{
    if (!$bg  || !$img) {
        return false;
    } else {
        
        // Eintelne Bilder
        // $bg = Hintergrund; immer!
        $bg = ImageCreateFromPNG($bg); // Hintergrund als Bild (PNG Format)
        
        foreach ($img as $key => $value)
        {
            $value['bild'] = ImageCreateFromPNG($value['bild']); // Bild erstellen
            
            $w = imagesx($value['bild']); // Breite berechnen
            $h = imagesy($value['bild']); // Höhe berechnen
            
            ImageCopy($bg, $value['bild'], $value['x'], $value['y'], 0, 0, $w,  $h); // Bild auf den background Kopieren
        }    
        imagePNG($bg, 'ava_'.$_GET['habbo'].'.png'); // Bild erstellen / speichern
    }
} 
PHP-Code:
	
	
$action = array();
        $action['action'] = '';
        $action['direction'] = 4;
        $action['head_direction'] = 3;
        $action['gesture'] = 'sml';    
    
        $img[0]['bild'] = "http://www.habbo.ch/habbo-imaging/avatarimage?user=".$_GET['habbo']."&action=".$action['action']."&direction=".$action['direction']."&head_direction=".$action['head_direction']."&gesture=".$action['gesture']."&img_format=png";
        $img[0]['x'] = 70;
        $img[0]['y'] = 70;
        
        $img[1]['bild'] = "avatars/schnee/unten.png";
        $img[1]['x'] = 80;
        $img[1]['y'] = 145;
        
        $img[2]['bild'] = "avatars/schnee/hand.png";
        $img[2]['x'] = 83;
        $img[2]['y'] = 140;
        
        get_ava('avatars/schnee/bg.png', $img); 
Ne 500er
http://www.habboboard.ch/avamaker/te...la&type=schnee
Währe foroh wen du helfen könntest
 
							
						 
          

Kommentar