既存の画像を読み込んで編集

概要

既存の画像を読み込んで四角形を描画


サンプル

<?php
	// 既存の画像より画像リソースを作成
	$im = imagecreatefrompng("./sample03.png");
 
	// 白色を作成
	$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
	// 黒色を作成
	$black = imagecolorallocate($im, 0x55, 0x55, 0x55);
 
	// 短形を描画する
	imagefilledrectangle($im, 50, 50, 150, 150, $black);
 
	// 画像出力
	header("Content-type: image/png");
	ImagePNG($im);
?>
 
 

イメージ




最終更新:2012年08月18日 09:25