退房此引用,我認爲這是你想要什麼:http://php.net/manual/en/function.imagecopyresized.php
<?php
// File and new size
$filename = 'test.jpg';
$percent = 0.5;
// Content type
header('Content-Type: image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb);
?>
那部分我已經,但即時通訊使用一個循環,我去了每一個像素,以確保它保持着適當的顏色和透明度,因爲有時只使用這種方法,你會得到空白的地方,你的圖像是黑色的。我現在需要的是如何將我的一個圖像放在另一個地方的某個地方 – 2012-03-02 22:00:35