-
-
function overlayjpg($imgsrc,$imgdst,$width,$height="")
- {
- //$imgsrc jpg格式图像路径 $imgdst jpg格式图像保存文件名 $imgwidth要改变的宽度 $imgheight要改变的高度
- //取得图片的宽度,高度值
- $arr = getimagesize($imgsrc);
- //计算图片x轴位置
- $img_x = ($width - $arr[0])/2;
- if($height == ""){
- $heights = $arr[1];
- $img_y = 0;
- }
- else{
- if($height $heights = $arr[1];
- $img_y = 0;
- }
- else{
- $heights = $height;
- $img_y = ($height - $arr[1])/2;
- }
- }
//$w = $arr[0];
Modoer多功能点评系统2.5 精华版 Build 20110710 UTF8
Modoer 是一款以本地分享,多功能的点评网站管理系统。采用 PHP+MYSQL 开发设计,开放全部源代码。因具有非凡的访问速度和卓越的负载能力而深受国内外朋友的喜爱,不局限于商铺类点评,真正实现了多类型的点评,可以让您的网站点评任何事与物,同时增加产品模块,也更好的网站产品在网站上展示。Modoer点评系统 2.5 Build 20110710更新列表1.同步 旗舰版系统框架2.增加 限制图片
下载
- //$h = $arr[1];
- // Create image and define colors
- $image = imagecreatetruecolor($width,$heights); //创建一个彩色的底图
- $bg = imagecolorallocate($image, 255, 255, 255);
- imagefill($image,0,0,$bg);
- $imgsrc = LoadIMG($imgsrc,$arr['mime']);
- imagecopy($image,$imgsrc,$img_X,$img_Y,0,0,$arr[0],$arr[1]);
- imagejpeg($image,$imgdst,90);
- //imagedestroy($image);
- }
- // 加载背景图片
- function LoadIMG($imgname,$mime)
- {
- if($mime == "image/gif"){
- $im = @imagecreatefromgif($imgname); /* Attempt to open */
- }
- elseif ($mime == "image/png"){
- $im = @imagecreatefrompng($imgname); /* Attempt to open */
- }
- else{
- $im = @imagecreatefromjpeg($imgname); /* Attempt to open */
- }
- if(!$im) { /* See if it failed */
- $im = imagecreatetruecolor(150, 30); /* Create a blank image */
- $bgc = imagecolorallocate($im, 255, 255, 255);
- $tc = imagecolorallocate($im, 0, 0, 0);
- imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
- /* Output an errmsg */
- imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
- }
- return $im;
- }
-
复制代码
|