かけがえのない日々

なんややんや。にょろにょろ。

画像処理

2008年02月04日 | PHP
//サイズ変更後の画像データを生成
//imagecreate()はgif,png用※255色以上の色は使用できず近似値補完されます
$afr_image1 = imagecreatetruecolor($afr_image_x1, $afr_image_y1);
$afr_image2 = imagecreatetruecolor($afr_image_x2, $afr_image_y2);
$afr_image3 = imagecreatetruecolor($afr_image_x3, $afr_image_y3);
$afr_image4 = imagecreatetruecolor($afr_image_x3, $afr_image_y3);
//イメージのサイズ変更
//imagecopyresized()だと鮮明な画像が作成されます。縮小の場合はimagecopyresampled()が適すると思われます。※ピクセル値を滑らかに補完します
imagecopyresampled($afr_image1, $image, 0, 0, 0, 0, $afr_image_x1, $afr_image_y1, $image_x, $image_y);
imagecopyresampled($afr_image2, $image, 0, 0, 0, 0, $afr_image_x2, $afr_image_y2, $image_x, $image_y);
imagecopyresampled($afr_image3, $image, 0, 0, 0, 0, $afr_image_x3, $afr_image_y3, $image_x, $image_y);
imagecopyresized($afr_image4, $image, 0, 0, 0, 0, $afr_image_x3, $afr_image_y3, $image_x, $image_y);