没有合适的资源?快使用搜索试试~ 我知道了~
php 缩略图实现函数代码
0 下载量 178 浏览量
2020-12-19
19:40:29
上传
评论
收藏 39KB PDF 举报
温馨提示
试读
1页
array getimagesize ( string $filename [, array &$imageinfo ] ) 取得图像大小 resource imagecreatetruecolor ( int $x_size , int $y_size ) 新建一个真彩色图像 resource imagecreatefromjpeg ( string $filename ) 从 JPEG 文件或 URL 新建一图像 bool imagecopyresized ( resource $dst_image , resource $src_image , int $dst_x , int $dst
资源推荐
资源详情
资源评论
php 缩略图实现函数代码缩略图实现函数代码
array getimagesize ( string $filename [, array &$imageinfo ] ) 取得图像大小
resource imagecreatetruecolor ( int $x_size , int $y_size ) 新建一个真彩色图像
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 ) 拷贝部分图像并调整大小
bool imagejpeg ( resource $image [, string $filename [, int $quality ]] ) 以 JPEG 格式将图像输出到浏览器或文件
复制代码 代码如下:
<?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使用imagick读取PDF生成png缩略图的两种方法php 根据url自动生成缩略图并处理高并发问题php
生成缩略图示例代码分享(使用gd库实现)php利用GD库生成缩略图示例使用gd库实现php服务端图片裁剪和生成缩略图功能分
享php生成缩略图填充白边(等比缩略图方案)PHP imagegrabscreen和imagegrabwindow(截取网站缩略图)的实例代码基于
PHP服务端图片生成缩略图的方法详解php图片的裁剪与缩放生成符合需求的缩略图PHPThumb PHP 图片缩略图库PHP缩略
图等比例无损压缩,可填充空白区域补充色PHP用GD库生成高质量的缩略图片兼容性最强的PHP生成缩略图的函数代码(修改
版)兼容性比较好的PHP生成缩略图的代码完美实现GIF动画缩略图的php代码php下尝试使用GraphicsMagick的缩略图功能
php图片处理:加水印、缩略图的实现(自定义函数:watermark、thumbnail)php实现上传图片生成缩略图示例
资源评论
weixin_38662122
- 粉丝: 5
- 资源: 949
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功