一、png圖片生成
public function entryOp() {
$img = 'http://newmall.yewugou.com/ylfapporderform/images/test.png';
list($width, $height) = @getimagesize($img);
$image = imagecreatefrompng($img);//創建圖片模板
imagesavealpha($image,true);//保留通道信息
$thumb = imagecreatetruecolor($width,$height);//創建真彩圖
//設置字體開始
$black = imagecolorallocate($image, 98, 52, 11);//拾色器
$font_file = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.'mobile'.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR.'msyh.ttf';
imagefttext($image, 25, 0, 980, 125, $black, $font_file, '2016年11月05日');
imagefttext($image, 25, 0, 980, 165, $black, $font_file, '2017年05月05日');
imagefttext($image, 25, 0, 630, 295, $black, $font_file, '夢兒');
imagefttext($image, 25, 0, 630, 390, $black, $font_file, '18005076960');
imagefttext($image, 25, 0, 630, 480, $black, $font_file, '18005076960');
imagefttext($image, 25, 0, 630, 570, $black, $font_file, '伐木累');
$color = imagecolorallocate($image, 255, 84, 31);
imagefttext($image, 40, 0, 530, 690, $color, $font_file, '動作');
//設置字體結束
imagealphablending($thumb,false);
imagesavealpha($thumb,true);
imagecopyresampled($thumb,$image,0,0,0,0,$width,$height,$width,$height);
header("content-type: image/png");
imagepng($thumb);
imagedestroy($image);
}
- 環境搭建
- centos6.5 lnmp環境搭建
- svn環境搭建
- centos lamp安裝配置
- mysql
- mysql常用命令
- mysql技術內幕
- 1.1mysql體系結構
- 1.2mysql存儲引擎
- 1.3mysql連接
- linux
- linux-常用命令
- linux下vim命令
- 第三方平臺開發
- 微信開發之旅
- php
- php框架
- lavarel常用命令
- thinkPhp常用命令
- yii2.0.8
- 安裝
- yii常用
- yii配置
- yii常用2
- php源碼積累
- php字符串截取
- php圖片處理(gd)
- 二維數組保持索引排序(高低)
- 獲取一個月首尾天數
- 時間函數
- php內置函數
- html
- js
- 基本命令
- js案例
- js去空格
- css
- 基本樣式
- 案例
- ul li 橫向水平居中自適應案例
- 固定底部導航欄并自適應
- 購物車帶角標
- display的兼容解決
- 前端框架
- boostrap
- 常用類
- git
- 上傳項目到遠程倉庫GitHub