Seite 38 von 45
Verfasst: 08.01.2006 13:59
von easygo
Wissler hat geschrieben:Sorry, ist mir nicht ganz klar. Muss ich das Format dann von .png auf .gif ändern?
Nö, das Image muss den Pfad, den Namen und das Format haben,
wie in der Zeile (in signature.php) steht -->
Wer die Datei schneewittchen.php genannt hat, sucht da.
Wie sich phpBB austricksen lässt, um ein php File in die Signatur
einzubinden und aufrufen zu lassen, steht hier (ff) -->
http://www.net4seven.de/fpost2872.html#2872
Viel lesen hilft viel. easy
Verfasst: 08.01.2006 14:35
von Wissler
Danke, hat sich erledigt (siehe meinen letzten Beitrag, bzw. meine Signatur

)
Verfasst: 13.01.2006 09:08
von okieh
moin ihrs
also irgendwie steh ich gerade aufm schlauch.
gestern hab ich meine *.png datei neu gemacht, nach dem upload ist aber die gesamte schrift in der signatur weiß. vorher war schwarz, grün, blau und rot enthalten. an der *.php hab ich nichts verändert *ickschwör*
so sieht die *.php (noch immer, wie eh und je) aus.
woran liegt denn diese farbveränderung? was muss ich ändern?
Code: Alles auswählen
$image = "../images/signature.png";
$im = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 0, 0, 0);
$red = ImageColorAllocate ($im, 255, 0, 0);
$green = ImageColorAllocate ($im, 23, 124, 17);
$dblue = ImageColorAllocate ($im, 0, 0, 255);
$version = '2'.$board_config['version'];
$sitename = $board_config['sitename'];
$total_users = get_db_stat('usercount');
$total_posts = get_db_stat('postcount');
$total_topics = get_db_stat('topiccount');
$j = strlen($total_users);
$leerzeichen = $j*6+237;
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
ImageString($im, 3, 60, 2, "Statistik von $sitename", $dblue);
ImageString($im, 2, 60, 15, "Anzahl Mitglieder: $total_users", $tc);
ImageString($im, 2, 60, 25, "Modellbauer Online: $logged_online", $red);
ImageString($im, 2, 60, 35, "Gäste online: $guests_online", $red);
ImageString($im, 2, 60, 45, "Wir haben $total_posts Postings in $total_topics Themen.", $tc);
ImageString($im, 2, 60, 55, "Neuestes $sitename Mitglied : $newest_user", $green);
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>
ps: hallo phili

Verfasst: 13.01.2006 12:32
von Wissler
@okieh:
I've noticed a couple of things with the ImageCreateFromPng function that may be useful if your having problems.
1st thing I noticed is that the PNG file you are creating from needs to be indexed and less than 256 colors.
Secondly, you need to reduce the color depth by 1 for each color you plan on generating in php... I.E. if you plan on drawing 50 different colors on the screen with php you need to allocate space for them by reducing the origional image's color depth to 205 colors (I was pulling my hair out on this one for a while because the wrong colors were showing up in the output).
Also, if you are saving the image as a PNG you need to allocate the 1st color as white.. The reason for this is that Internet Explorer seems to interpret the first color in an indexed PNG as white no matter what color it is... (Figured this out when all my pretty black text was turning up as white in I.E. and was normal in Netscape; allocated the first color in the image as white and the problem went away.)
Verfasst: 13.01.2006 12:35
von Wissler
(Wie) Kann man eigentlich die Schriftart ändern, wenn man $im = imagecreatefrompng($image); verwendet?
Verfasst: 14.01.2006 13:01
von Endres
Aber wie macht man das , mit der Signatur??? Bei mir funzt das nämlich nicht, außer wenn man den im Browser aufruft...
[ externes Bild ] PHP
[ externes Bild ] GIF
[ externes Bild ] PNG
[ externes Bild ] JPG
...
Verfasst: 14.01.2006 14:44
von Wissler
Auf .php kann man nicht verlinken. Aber das ist in diesem Thread
schon ausführlich erklärt ...
Verfasst: 14.01.2006 14:51
von okieh
@Wissler:
danke für deinen tipp, es lag an der bit-tiefe. ich hatte fälschlicherweise 8 statt 32.
bye
Verfasst: 15.01.2006 10:37
von Endres
@Wissler
Aber ihr habt das doch auch in der Signatur hingekriegt!
Verfasst: 15.01.2006 10:46
von Valerie Raghnall