嗨,我刚刚编写了代码:
<?php
$ur = $user['Skin'];
$filename = "img/Skins/" . $ur;
list($w, $h, $type, $attr) = getimagesize($filename);
$img = imagecreatefrompng($filename);
$src_im = imagecreatefrompng($filename);
$src_x = '30'; // begin x
$src_y = '45'; // begin y
$src_w = '40'; // width
$src_h = '35'; // height
$dst_x = '0'; // destination x
$dst_y = '0'; // destination y
$dst_im = imagecreatetruecolor($src_w, $src_h);
$white = imagecolorallocate($dst_im, 255, 255, 255);
imagefill($dst_im, 0, 0, $white);
imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);
?>
<img src="<?php print_r(imagepng($dst_im)); ?>"/>
这应该做的是获取图像“皮肤”并剪下头部,所以我的图像:
<img src="<?php print_r(imagepng($dst_im)); ?>"/>
应该只是头部的皮肤。但是,我得到了这个胡言乱语:
ù¬åä) BðÔ€ÛÂ~Í‹P3£Œ´¶ÛÛ A†YEUkÌ¡èæ_Ê!ÊÔgò s“Û¤ÇC,MŒ+‰?>¡·Ñ[ïªWf™.œsḜ3€@á¦~vþf ŒÀì¢ ª}à9¹#åIĉꕡ èˆÀî”Ûw¥@ù"¢¢™áHªUúݸ÷ÉÇYÿ®šGÅçǘîwqžˆ³ýÏJ ÕKSêô¯Tis“†Ã¡í©ÈK‡}G:Xqt×ÓIJEpT,úŽ¿ƒ ~¼lÞÈÚ6]_Óœ>®çqÿNÏ'çqWŠjš-…(—=g¿ÁŸÍgæ+ùB¹R©Öwܸþn¤:C‰õØËüÛïݱI¸°\ÉÌ[%«V³7ÞÕM¾Í>[ké·IEND®B`‚1"/ >
我应该怎么做,我该如何解决?
谢谢!