Suche im Forum:
Suchen


Autor Nachricht
Beitrag06.11.2009 um 14:17 (UTC)    
Titel: Php: ein Bild

Code:
<?php
Header("Content-Type: image/png");
$width = 500;
$height = 200;
$pic = imagecreatefrompng('./bild.png');
$img = ImageCreate($width, $height);
$bgc = ImageColorAllocate($img, 0, 0, 0);
ImageFill($img, 0, 0, $black);
ImagePNG($img);
?>


Das habe ich aber wie, kann ich es machen das $pic in das Bild mit dem hintergrund $bgc kommt ?

Kann mir pls jemand helfen?


Zuletzt bearbeitet von eni-test am 06.11.2009, 18:45, insgesamt 3-mal bearbeitet
↑
Beitrag07.11.2009 um 01:28 (UTC)    
Titel:

dafür gibts den befehl copy bzw merge in gdlib
______________
Video Portal Unplugged
Neues Gewinnspiel #1
Neues Gewinnspiel #2
↑
Beitrag07.11.2009 um 09:49 (UTC)    
Titel:

und wie geht das?
↑
Beitrag07.11.2009 um 10:23 (UTC)    
Titel:

Hab mal gegoogelt.
Hier:
http://php.net/manual/de/book.image.php

imagecopy darfst du dir selbst raussuchen.

mfg
______________
Forenregeln, FAQ, Suchfunktion
↑
Beitrag07.11.2009 um 10:41 (UTC)    
Titel:

Code:
<?php
Header("Content-Type: image/png");
$width = 500;
$height = 200;
$pic = imagecreatefrompng('./bild.png');
$img = ImageCreate($width, $height);
$black = ImageColorAllocate($img, 0, 0, 0);
$bild = ImageFill($img, 0, 0, $black);

$img = ImageCopy  ( resource $bild  , resource $pic  int 0  , int 0  , int 0  , int 0  , int $width  , int $height  );
ImagePNG($img);
?>


so?


Zuletzt bearbeitet von eni-test am 07.11.2009, 11:43, insgesamt einmal bearbeitet
↑
Beitrag07.11.2009 um 13:31 (UTC)    
Titel:

eni-test hat Folgendes geschrieben:
Code:
<?php
Header("Content-Type: image/png");
$width = 500;
$height = 200;
$pic = imagecreatefrompng('./bild.png');
$img = ImageCreate($width, $height);
$black = ImageColorAllocate($img, 0, 0, 0);
$bild = ImageFill($img, 0, 0, $black);

$img = ImageCopy  ( resource $bild  , resource $pic  int 0  , int 0  , int 0  , int 0  , int $width  , int $height  );
ImagePNG($img);
?>


so?

Na ein einfaches Copy&Paste langt da nicht -.- wie du siehst funktioniert es ja sicherlich nicht und warum nicht??
Ließ dir die Seite, woher du den teilcode hast nochmal genauer durch...dann solltest du ihn auch verstehen
↑
Beitrag07.11.2009 um 19:59 (UTC)    
Titel:

Zitat:
$pic = imagecreatefrompng('./bild.png');
$img = ImageCreate($width, $height);


du kannst nicht zwei create funktionen gleichzeitig benutzen die überschreiben sich gegenseitig

genau lesen

Code:
$full = imagecreatetruecolor ($width, $height);

$bg = imagecolorallocate ($full, 255, 255, 255);

// int ImageCopy  ( resource $dst_im  , resource $src_im  , int $dst_x  , int $dst_y  , int $src_x  , int $src_y  , int $src_w  , int $src_h  )
//Kopiert einen Teil des Quellbildes src_im nach dst_im . Der zu kopierende Teil wird angegeben über die x/y-Koordinaten src_x und src_y .
//Die Breite wird in src_w und die Höhe in src_h angegeben. Der Ausschnitt wird an die x/y-Koordinaten dst_x und dst_y kopiert.
imagecopy($full, $red, 0, 0, 0, 0, $width, $height);
imagecopy($full, $green, $percent_box, 0, 0, 0, $width, $height);

header('Content-Type: image/png');
imagepng($full);

imagedestroy($red);
imagedestroy($green);
imagedestroy($full);


bei dir wäre $img statt $full $red ist in diesme beispiel das bild was auf den hintergrund bzw das andere bild an entsprechender stelle kopiert wird
______________
Video Portal Unplugged
Neues Gewinnspiel #1
Neues Gewinnspiel #2
↑
Beiträge der letzten Zeit anzeigen:   


Powered by phpBB © 2001, 2005 phpBB Group
Deutsche Übersetzung von phpBB.de