ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
2086
2086
EMPFEHLEN
-
Hallo, ich will für mein Fotoalbum ein "Bilderstapel-Feature" einbauen, wo man die ersten 2(3,4) Bilder eines Verzeichnisses leicht gedreht übereinander angezeigt bekommt.
(Ähnlich wie im WMP 10, Bild im Anhang).
Dazu benutze ich die GD-Lib (v2.0)
Das Problem: Es werden beliebige Bildtypen (GIF/JPG/PNG) ausgelesen, das Endbild soll aber transparent sein (Es soll halt ein transparenter Hintergrund sein), PHP liefert aber einen schwarzen Hintergrund, obwohl ich imagesavealpha() verwende und das Bild als PNG ausgebe. Außerdem wird nur das letze (oberste) Bild angezeigt->Es überlagert mit dem schwarzen Hintergrund die anderen Bilder...
Hier der Code (in Auszügen):
config_photogallery.php
rotate.phpPHP-Code:$config_photogallery['width']="150";
$config_photogallery['pilestep']="5";
Das Ergebnis kann man sich unter http://diesv.de/v1/photogallery/rotate.php ansehen.PHP-Code:<?php
include_once "config_photogallery.php";
include_once "functions.inc.php";
function picpile($pictures, $step = '')
{
global $config_photogallery;
if ($step == "")
{
$step = $config_photogallery['pilestep'];
}
$pictures = explode("|", $pictures); //Bilder in Array
$angle = "0"; //Aktueller Drehwinkel, wird in den Schleifen geändert
$p['pile'] = imagecreatetruecolor($config_photogallery['width'], $config_photogallery['width']);
imagesavealpha ($p['pile'], true);
foreach($pictures as $key => $value)
{
$imagesize[$key] = getimagesize($value);
switch ($imagesize[$key][2])
{
case 1:
$imagesize[$key]['type'] = "GIF";
break;
case 2:
$imagesize[$key]['type'] = "JPEG";
break;
case 3:
$imagesize[$key]['type'] = "PNG";
break;
default:
$imagesize[$key]['type'] = null;
} // switch
$p[$key] = call_user_func("imagecreatefrom" . $imagesize[$key]['type'], $value); //Bild einlesen
imagesavealpha ($p[$key], true);
$p['temp'] = imagecreatetruecolor($config_photogallery['width'], $config_photogallery['width']); //Temp-Bild mit Pilegröße erstellen, dieses wird auf den vorhandenen Stapel draufkopiert
imagesavealpha ($p['temp'], true);
$breite_thumb = $config_photogallery['width'] / 2;
$hoehe_thumb = ($config_photogallery['width'] / 2) * ($imagesize[$key][1] / $imagesize[$key][0]);
$x_thumb = $config_photogallery['width'] / 4;
$y_thumb = ($config_photogallery['width'] - $hoehe_thumb) / 2;
imagecopyresampled($p['temp'], $p[$key], $x_thumb, $y_thumb, 0, 0, $breite_thumb, $hoehe_thumb, $imagesize[$key][0], $imagesize[$key][1]);
$p['temp'] = ImageRotate($p['temp'], $angle, -1);
imagesavealpha ($p['temp'], true);
imagecopy($p['pile'], $p['temp'], 0, 0, 0, 0, imagesx($p['temp']), imagesy($p['temp']));
$angle += $step; //aktuellen Drehwinkel vergrößern
imagedestroy($p[$key]);
imagedestroy($p['temp']);
}
header("Content-type: image/png");
imagepng($p['pile']);
}
picpile("pics/Windows Vista/Wallpapers/Garden.jpg|pics/Windows Vista/Wallpapers/Tukan.jpg")
?>
Ich habe die "zu stapelnden Bilder", wie es aussehen sollte und wie es aussieht angehängt.
Ich weiß, dass die Bilder momentan mit den Einstellungen kaum sichtbar und zu klein sind, dass werde ich ändern
Ich hoffe, jemand kennt dieses Problem und weiß eine Lösung...
PS: PHP 4Geändert von flokli (23.07.06 um 21:42 Uhr)
Why is Ajax so smart?
-You can kill your server without a reload.
Ähnliche Themen
-
Transparenz in *.tga ?
Von soyo im Forum PhotoshopAntworten: 0Letzter Beitrag: 09.02.07, 13:09 -
transparenz
Von Luminus im Forum PhotoshopAntworten: 9Letzter Beitrag: 15.04.04, 19:35 -
Transparenz
Von derschatten im Forum Cinema 4DAntworten: 2Letzter Beitrag: 10.04.03, 11:53 -
transparenz
Von Matherix im Forum PhotoshopAntworten: 3Letzter Beitrag: 14.02.03, 22:01 -
transparenz
Von Matherix im Forum PhotoshopAntworten: 5Letzter Beitrag: 01.02.03, 13:56





Zitieren
Login






[PHP][Snippet] Array zu XML konvertieren