<?php
//// The file
//$filename = '1.gif';
//$dst_img='yj.jpg';
//// Set a maximum height and width
//$width = 800;
//$height = 400;
//
//// Content type
//header('Content-type: p_w_picpath/jpeg');
//
////// Get new dimensions
////list($width_orig, $height_orig) = getp_w_picpathsize($filename);
////
////if ($width && ($width_orig < $height_orig)) {
//// $width = ($height / $height_orig) * $width_orig;
////} else {
//// $height = ($width / $width_orig) * $height_orig;
////}
//
//// Resample
//$p_w_picpath_p = p_w_picpathcreatetruecolor($width, $height);
//$p_w_picpath = p_w_picpathcreatefromgif($filename);$p_w_picpath1 = p_w_picpathcreatefromjpeg($dst_img);
//p_w_picpathcopyresampled($p_w_picpath_p, $p_w_picpath1, 0, 0, 0, 0, $width, $height, 800, 800);
//
//// Output
//p_w_picpathjpeg($p_w_picpath_p, null, 100);
function dxml($dir_path){
$dir_path=$dir_path;
if($dir_resource=@opendir($dir_path)){
while($str=readdir($dir_resource)){
//echo $dir_path.'/'.$str.'<br/>';
if($str!='.' && $str!='..'){
if(is_dir($dir_path.'/'.$str)){
echo '<font color="red">'.$dir_path.'/'.$str.'</font><br/>';
dxml($dir_path.'/'.$str);}
else{
echo $str.'<br/>';
}
}
}
}
else{
echo '不是文件目录';
}
}
//dxml('d:\www\apple');
function add_sy($filename,$sy_img=''){
$filename=$filename;
$sy_img=$sy_img;
$arr=array();
$arr=getp_w_picpathsize($filename);
$width=$arr[0];
$height=$arr[1];
switch($arr[2]){
case 1:
$dst_img=p_w_picpathcreatfromgif($filename);
break;
case 2:
$dst_img=p_w_picpathcreatefromjpeg($filename);
break;
case 3:
$dst_img=p_w_picpathcreatfrompng($filename);
break;
case 6:
$dst_img=p_w_picpathcreatfromwbmp($filename);
break;
default:
die('不支持文件类型');}
$sy_img=p_w_picpathcreatefromgif($sy_img);
p_w_picpathcopy($dst_img,$sy_img,10,10,0,0,297,109);
p_w_picpathjpeg($dst_img,'dsq.gif',100);
}
add_sy('mm.jpg','1.gif');
?>