Scaling and Rotating : imagecreatetruecolor « Graphics Image « PHP






Scaling and Rotating

 
<?php
    header("content-type: image/png");
    $src_img = imagecreatefrompng("complicated.png");
    $srcsize = getimagesize("complicated.png");
    $dest_x = $srcsize[0] / 1.5;
    $dest_y = $srcsize[1] / 1.5;
    $dst_img = imagecreatetruecolor($dest_x, $dest_y);

    imagecopyresized($dst_img, $src_img, 0, 0, 0, 0,$dest_x, $dest_y, $srcsize[0], $srcsize[1]);
    imagepng($dst_img);
    imagedestroy($src_img);
    imagedestroy($dst_img);
?>
  
  








Related examples in the same category