色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php 縮略圖實(shí)現(xiàn)函數(shù)代碼

array getimagesize ( string $filename [, array &$imageinfo ] ) 取得圖像大小
resource imagecreatetruecolor ( int $x_size , int $y_size ) 新建一個(gè)真彩色圖像
resource imagecreatefromjpeg ( string $filename ) 從 JPEG 文件或 URL 新建一圖像
bool imagecopyresized ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h ) 拷貝部分圖像并調(diào)整大小
bool imagejpeg ( resource $image [, string $filename [, int $quality ]] ) 以 JPEG 格式將圖像輸出到瀏覽器或文件
復(fù)制代碼 代碼如下:
<?php
/*
Created by <A href="http://www.cnphp.info">http://www.cnphp.info</A>
*/
// 文件及縮放尺寸
//$imgfile = 'smp.jpg';
//$percent = 0.2;
header('Content-type: image/jpeg');
list($width, $height) = getimagesize($imgfile);
$newwidth = $width * $percent;
$newheight = $height * $percent;
$thumb = ImageCreateTrueColor($newwidth,$newheight);
$source = imagecreatefromjpeg($imgfile);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
imagejpeg($thumb);
?>

php技術(shù)php 縮略圖實(shí)現(xiàn)函數(shù)代碼,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 永清县| 沂源县| 贵阳市| 大关县| 广丰县| 东平县| 清流县| 江阴市| 江北区| 六盘水市| 洪雅县| 阜阳市| 曲阜市| 紫金县| 册亨县| 白山市| 军事| 甘洛县| 刚察县| 双峰县| 惠水县| 镇宁| 房山区| 赞皇县| 五河县| 云林县| 乌鲁木齐县| 柳河县| 博野县| 永泰县| 清徐县| 江城| 游戏| 商南县| 棋牌| 来宾市| 宝清县| 仁怀市| 昔阳县| 桓台县| 凤庆县|