WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

 
 
Themen-Optionen Ansicht
Alt 20.01.2008, 13:42   #4
void
Hero
 
Benutzerbild von void
 
Registriert seit: 26.07.2001
Ort: Wien
Beiträge: 811


Standard

hast du schon eine lösung? bei mir schaut das ungefähr so aus:
PHP-Code:
<?php
$height 
150;
$width 100;

$img $_GET['img'];
if(
file_exists($img))
{
    
$dim getimagesize($img);
    switch (
$dim[2]) {
      case 
2:
        
$cr imagecreatefromjpeg($img);
        break;
      case 
3:
        
$cr imagecreatefrompng($img);
        break;
      default:
        exit();
    }
    
header("Content-type: " image_type_to_mime_type($dim[2]));
    
$im imagecreatetruecolor($width$height);
    
// TODO: add random
    
$rnd_x 0;
    
$rnd_y 0;
    
imagecopy($im$cr000+$rnd_x0+$rnd_y$width+$rnd_x$height+$rnd_y);
    switch (
$dim[2]) {
      case 
2:
        
imagejpeg($im);
        break;
      case 
3:
        
imagepng($im);
        break;
    } 
    
imagedestroy($cr);
    
imagedestroy($im);
}
?>
____________________________________
nobody is perfect
void ist offline   Mit Zitat antworten
 


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 20:29 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag