util.iconripper.php 590 B

1234567891011121314151617181920212223
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set('display_startup_errors', 1);
  4. error_reporting(E_ALL);
  5. $src = imagecreatefrompng('./items/src/icon_is1-min.png');
  6. $dest = imagecreatetruecolor(42,42);
  7. imagesavealpha($dest, true);
  8. $trans_color = imagecolorallocatealpha($dest, 0, 0, 0, 127);
  9. imagefill($dest, 0, 0, $trans_color);
  10. /* - - - >dest, src, dest_x, dest_y, src_pos_x, src_pos_y, src_w, src_h */
  11. imagecopy($dest, $src, 0,0, 0, 0, 42, 42);
  12. header('Content-Type: image/png');
  13. imagepng($dest);
  14. imagedestroy($dest);
  15. imagedestroy($src);
  16. ?>