【php实现背景图上添加圆形logo图标】教程文章相关的互联网学习教程文章

用php生成带有雪花背景的验证码

用php生成带有雪花背景的验证码,有需要的朋友可以参考下。以下代码,有详细的注释,方便学习。

php生成透明背景图片实例

//透明背景图片header(‘content-type:text/html;charset=gbk’);$safess = $_get[safe];$dir = dirname(__file__).”/simsun.ttc”;$safe=iconv(“gb2312″,”utf-8″,$safess); $im=imagecreatetruecolor(160,18); $color=imagecolorallocate($im,229,231,230); imagecolortransparent($im,$color); // 设置为透明色,若注释掉该行则输出上面设置的背景 imagefill($im,0,0,$color); $textcolor=imagecolorallocate($im,0,0,0); i...

php图片背景填充实例

<?php/*** 添加背景* @param string $src 图片路径* @param int $w 背景图像宽度* @param int $h 背景图像高度* @return 返回加上背景的图片* **/public function addBg($src,$w,$h){$bg = imagecreatetruecolor($w,$h);$white = imagecolorallocate($bg,255,255,255);imagefill($bg,0,0,$white);//填充背景//获取目标图片信息$info=getimagesize($src);$width=$info[0];//目标图片宽度$height=$info[1];//目标图片高度switch ($in...

php为图片增加背景实例代码

<?phpfunction 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 <= $arr[1]){ $heights = $arr[1]; $img_Y = 0; } ...

php背景图片怎么生成

php背景图片怎么生成 :<?php $image = imagecreatetruecolor($imgWidth, $imgHeight); $white = imagecolorallocate($image, 255, 255, 255); imagefill($image, 0, 0, $white);以上就是php背景图片怎么生成 的示例代码,更多相关内容请关注PHP中文网(www.gxlcms.com)!

phpcss文件背景图片下载器实现代码

/** *@阿唐 2013-4-6 22:19 *@呵呵 */ set_time_limit(0); error_reporting(E_ERROR); if($argcprint_r(' +-------------------------------------------------+ Usage: php '.$argv[0].' css路径类型(0为远程、1为本地) css文件路径 图片保存目录 Example: php.exe '.$argv[0].' 0 http://www.xxx.com/index.css \images\ +-------------------------------------------------+ '); exit...

php水印代码,php半透明水印支持png透明背景

//原始图像 $dst = "/upload/20140914/20120914040740-0.jpg"; //图片路径//原始图片信息 $dst_info = getimagesize($dst); switch ($dst_info[2]) { case 1: $dst_im =imagecreatefromgif($dst);break; case 2: $dst_im =imagecreatefromjpeg($dst);break; case 3: $dst_im =imagecreatefrompng($dst);break; case 6: $dst_im =imagecreatefromwbmp($dst);break; default: die("不支持的文件类型1");exit; } //水印图像 $src = "...

php图片水印类支持水印透明与背景透明

/** * 加水印类,支持文字图片水印的透明度设置、水印图片背景透明。 * 日期:2011-09-27 * 作者:bbs.it-home.org* 使用: * $obj = new WaterMask($imgFileName); //实例化对象 * $obj->$waterType = 1; //类型:0为文字水印、1为图片水印 * $obj->$transparent = 45; //水印透明度 * $obj->$waterStr = 'bbs.it-home.org'; //水印文字 * $obj->$fontSize = 16; //文字字体大小 * $obj->$fontColor = array(255,0255); //水印文字...

phpimagick函数设置图片背景透明【图】

$image = new Imagick('1.png');$image->borderImage(new ImagickPixel("white"),1,1);$image->paintfloodfillimage('transparent',2000,NULL,0,0);$draw = new ImagickDraw();$draw->color(0,0,imagick::PAINT_FLOODFILL);$image->drawImage($draw);$image->shaveImage(1,1);header("Content-Type: image/{$image->getImageFormat()}");echo $image->getImageBlob( );//$image->writeImage('o.png');$image->clear();$image->dest...

基于GD库的php验证码类且支持中英文字体、背景、干扰点线、扭曲等

基于GD库的php验证码类(支持中英文字体、背景、干扰点线、扭曲.......) <?php /* * Captcha Class base on PHP GD Lib * @author Design * @version 1.0 * @copyright js8.in 2010 * @demo * include(captchaClass.php); * $captchaDemo=new Captcha(); * $captchaDemo->createImage(); */ class Captcha { //@定义验证码图片高度 private $height; //@定义验证码图片宽度 private $width; //@定义验证码字符个数 private $textN...

PHP实现对png图像进行缩放的方法(支持透明背景)

本文实例讲述了PHP实现对png图像进行缩放的方法。分享给大家供大家参考。具体实现方法如下: function smart_resize_image( $file, $width = 0, $height = 0, $proportional = false, $output = file, $delete_original = true, $use_linux_commands = false ){ if ( $height <= 0 && $width <= 0 ) { return false; } $info = getimagesize($file); $image = ; $final_width = 0; $final_height = 0; l...

PHP生成带有雪花背景的验证码_PHP教程

效果参考(附源码)http://mail.htjs.net/yanzhengma/test.php();?> //检验校验码 if(isset($HTTP_POST_VARS["sub"])): if($HTTP_POST_VARS["number"] != $HTTP_SESSION_VARS[login_check_number] || empty($HTTP_POST_VARS["number"])){ echo "校验码不正确!" ; }else{ echo"验证码通过!"; } endif; show_source('test.php'); //以上本页的源码 //以下是生成验证码的源码 show_source('YanZhengMa.php'); ?> session_star...

php加水印的代码(支持半透明透明打水印,支持png透明背景)_PHP教程

代码如下://原始图像 $dst = "/upload/20120914/20120914040740-0.jpg"; //注意图片路径要正确 //得到原始图片信息 $dst_info = getimagesize($dst); switch ($dst_info[2]) { case 1: $dst_im =imagecreatefromgif($dst);break; case 2: $dst_im =imagecreatefromjpeg($dst);break; case 3: $dst_im =imagecreatefrompng($dst);break; ...

PHP对png图像进行缩放,支持透明背景_PHP教程【图】

PHP 对 png 图像进行缩放,支持透明背景Copy to Clipboard引用的内容:[www.bkjia.com] function smart_resize_image( $file, $width = 0, $height = 0, $proportional = false, $output = 'file', $delete_original = true, $use_linux_commands = false ) { if ( $height return false; } $info = getimagesize($file); $image = ''; $final_width = 0; $final_height = 0; list($width_old, $height_old) = $info; if ($proport...

PHP生成雪花背景的网站验证码_PHP教程

以下为引用的内容://检验校验码 if(isset($HTTP_POST_VARS["sub"])): if($HTTP_POST_VARS["number"] != $HTTP_SESSION_VARS[login_check_number] || empty($HTTP_POST_VARS["number"])){ echo "校验码不正确!" ; }else{ echo"验证码通过!"; } endif; show_source('test.php'); //以上本页的源码//以下是生成验证码的源码 show_source('YanZhengMa.php'); ?> session_start(); session_register("login_check_number");...