<?php
//imagefilledellipse — 画一椭圆并填充
/*bool imagefilledellipse ( resource $image , int $cx , int $cy , int $w , int $h , int $color )
$image:图片资源
$cx:左边离圆心的位置
$cy:上边离圆心的位置
$w:圆形的直径(左右方向)
$h:圆形的直径(上下方向)
$color:填充的颜色
$im = imagecreatetruecolor(100,100);
$red = imagecolorallocate($im,0,255,0);
imagefilledellipse($im,50,50,80,80,$red);
header('Content-type: image/png');
imagepng($im);
*/ //imagefilledpolygon — 画一多边形并填充
/*bool imagefilledpolygon ( resource $image , array $points , int $num_points , int $color )
$image:图片资源
$points:参数是一个按顺序包含有多边形各顶点的 x 和 y 坐标的数组
$num_points:参数是顶点的总数,必须大于 3
$color:颜色
$im = imagecreatetruecolor(200,200);
$value = array( 25,40,36,53,87,12,45,98,56,23);
$red = imagecolorallocate($im,255,0,0);
imagefilledpolygon($im,$value,5,$red);
header('Content-type: image/png');
imagepng($im);
*/ //imagefilledrectangle — 画一矩形并填充
/*bool imagefilledrectangle ( resource $image , int $x1 , int $y1 , int $x2 , int $y2 , int $color )
$image:图片资源
$x1:点到左边的距离
$y1:点到上边的距离
$x2:点到左边的距离
$y2:点到上边的距离
$color:填充的颜色
$im = imagecreatetruecolor(200,200);
$red = imagecolorallocate($im,255,0,0);
imagefilledrectangle($im,10,10,190,190,$red);
header('Content-type:image/png');
imagepng($im);
*/ //imagefontheight — 取得字体高度
/*$font_size = 1;
$a = imagefontheight($font_size);
echo $a;
*/ //imagefontwidth — 取得字体宽度
/*$font_size = 1;
$b = imagefontwidth($font_size);
echo $b;
*/ //imageline — 画一条线段
/*bool imageline ( resource $image , int $x1 , int $y1 , int $x2 , int $y2 , int $color )
$image:图片资源
$x1:点到左边的距离
$y1:点到上边的距离
$x2:点到左边的距离
$y2:点到上边的距离
$color:线段的颜色
$im = imagecreatetruecolor(200,200);
$red = imagecolorallocate($im,255,0,0);
imageline($im,10,10,100,100,$red);
header('Content-type:image/png');
imagepng($im);
*/ //imagepolygon — 画一个多边形
/*bool imagepolygon ( resource $image , array $points , int $num_points , int $color )
$image:图片资源
$points:参数是一个按顺序包含有多边形各顶点的 x 和 y 坐标的数组
$num_points:是顶点的总数。大于3
$color:线段的颜色
$im = imagecreatetruecolor(200,200);
$red = imagecolorallocate($im,255,0,0);
$value = array(13,45,23,56,23,45,78,99);
imagepolygon($im,$value,4,$red);
header('Content-type:image/png');
imagepng($im);
*/ //imagerectangle — 画一个矩形
/*bool imagerectangle ( resource $image , int $x1 , int $y1 , int $x2 , int $y2 , int $col )
$image:图片资源
$x1:点到左边的距离
$y1:点到上边的距离
$x2:点到左边的距离
$y2:点到上边的距离
$col:线段的颜色
$im = imagecreatetruecolor(200,200);
$red = imagecolorallocate($im,255,0,0);
imagerectangle($im,10,10,100,100,$red);
header('Content-type:image/png');
imagepng($im);
*/ //imagerotate — 用给定角度旋转图像
/*resource imagerotate ( resource $src_im , float $angle , int $bgd_color [, int $ignore_transparent ] )
$src_im:资源图片
$angle:旋转的度数
$bgd_color:背景颜色
$source = imagecreatefromjpeg('1.jpg');
$rotate = imagerotate($source,45, 26);
header('Content-type: image/jpeg');
imagejpeg($rotate);
*/ //imagesetpixel — 画一个单一像素
/*bool imagesetpixel ( resource $image , int $x , int $y , int $color )
$image:图片资源
$x:点到左边的距离
$y:点到上边的距离
$color:点的颜色
$im = imagecreatetruecolor(100,100);
$red = imagecolorallocate($im,255,0,0);
imagesetpixel($im,50,50,$red);
header('Content-type: image/jpeg');
imagejpeg($im);
*/ //imagesetstyle — 设定画线的风格
/*bool imagesetstyle ( resource $image , array $style )
$image:图片资源
$style:style 参数是像素组成的数组。下面的示例脚本在画布上从左上角到右下角画一行虚线:
header("Content-type: image/jpeg");
$im = imagecreatetruecolor(100, 100);
$w = imagecolorallocate($im, 255, 255, 255);
$red = imagecolorallocate($im, 255, 0, 0);
$style = array($red, $red, $red, $red, $red, $w, $w, $w, $w, $w);
imagesetstyle($im,$style);
imageline($im, 0, 0, 100, 100, IMG_COLOR_STYLED);
imagejpeg($im);
imagedestroy($im);
*/ //imagestring — 水平地画一行字符串
/*bool imagestring ( resource $image , int $font , int $x , int $y , string $s , int $col )
$image:图片资源
$font:字体大小
$x:文字到左边的距离
$y:文字到上边的距离
$s:文字内容
$col:文字颜色
$im = imagecreatetruecolor(100,100);
$red = imagecolorallocate($im, 255, 0, 0);
imagestring($im,5,10,10,'helloworld',$red);
header("Content-type: image/jpeg");
imagejpeg($im);
imagedestroy($im);
*/ //imagestringup — 垂直地画一行字符串
/*bool imagestringup ( resource $image , int $font , int $x , int $y , string $s , int $col )
$image:图片资源
$font:字体大小
$x:文字到左边的距离
$y:文字到上边的距离
$s:文字内容
$col:文字颜色
$im = imagecreatetruecolor(100,100);
$red = imagecolorallocate($im, 255, 0, 0);
imagestringup ($im,5,20,90,'helloworld',$red);
header("Content-type: image/jpeg");
imagejpeg($im);
imagedestroy($im);
*/ //imagesx — 取得图像宽度
/*$im = imagecreatetruecolor(200,100);
echo imagesx($im);
*/ //imagesy — 取得图像长度
/*$im = imagecreatetruecolor(200,100);
echo imagesy($im);
*/ //imagegd2 — 将 GD2 图像输出到浏览器或文件
//imagegd — 将 GD 图像输出到浏览器或文件
//imagegif — 以 GIF 格式将图像输出到浏览器或文件
//imagejpeg — 以 JPEG 格式将图像输出到浏览器或文件
//imagepng — 以 PNG 格式将图像输出到浏览器或文件
//imagewbmp — 以 WBMP 格式将图像输出到浏览器或文件
//imagexbm — 将 XBM 图像输出到浏览器或文件
/*以上都是函数如果有第二个参数那么会保存到文件上,如果没有第二个参数则会输出到浏览器上*/ ?>

php-GD库函数(三)的更多相关文章

  1. PHP的GD库函数大全

    GetImageSize作用:取得图片的大小[即长与宽]  用法:array GetImageSize(string filename, array [imageinfo]); ImageArc作用: ...

  2. Linux 文件管理(C语言库函数三)

    找到当前目录 char *getcwd(char * buf,size_t size) getcwd函数把当前工作目录的绝对路径名复制到buf中,size指示buf的大小 如果buf不够大,不能装下整 ...

  3. PHP中GD库函数

    画椭圆弧 imagearc($image,$cx,$cy,$width,$height,$angel1,$angel2,$color) 注释:$image 图像资源   $cx  椭圆中心点的水平位置 ...

  4. React-Native 之 GD (三)近半小时热门

    1.设置页面跳转 半小时热门组件  GDHalfHourHot.js /** * 近半小时热门 */ import React, { Component } from 'react'; import ...

  5. PHP扩展使用-GD

    一.相关函数 1. 获取信息 gd_info() #查看当前系统环境gd库支持的图片格式 getimagesize(imagefile) #获取图像大小,非GD库函数 imagex(imagefile ...

  6. PHP5 GD库生成图形验证码(汉字)

    PHP5 GD库生成图形验证码且带有汉字的实例分享. 1,利用GD库函数生成图片,并在图片上写指定字符imagecreatetruecolor 新建一个真彩色图像imagecolorallocate ...

  7. PHP图片处理之图片背景、画布操作

    像验证码或根据动态数据生成统计图标,以及前面介绍的一些GD库操作等都属于动态绘制图像.而在web开发中,也会经常去处理服务器中已存在的图片.例如,根据一些需求对图片进行缩放.加水印.裁剪.翻转和旋转等 ...

  8. 关于PHP批量图片格式转换的问题--本文转成webp, 其他过程格式一样

    最近要把项目中的图片全部生成webp格式, 过程整理一下,    (直接存在本地,或者图片链接存在数据库都可以看看) 首先,肯定是批量处理, 一个php处理不了这么多, 会爆内存的, 个人建议用aja ...

  9. PHP14 动态图像处理

    学习要点 如何使用PHP中的GD库 设计验证码类 PHP图片处理 设计图像图处理类 如何使用PHP中的GD库 在网站上GD库通常用来生成缩略图,或者用来对图片加水印,或者用来生成汉字验证码,或者对网站 ...

随机推荐

  1. javascript (十) 变量

    变量必须以字母开头 变量也能以 $ 和 _ 符号开头(不过我们不推荐这么做) 变量名称对大小写敏感(y 和 Y 是不同的变量) 声明(创建) JavaScript 变量 在 JavaScript 中创 ...

  2. RPC 的概念模型与实现解析(转)

    今天分布式应用.云计算.微服务大行其道,作为其技术基石之一的 RPC 你了解多少?一篇 RPC 的技术总结文章,数了下 5k+ 字,略长,可能也不适合休闲的碎片化时间阅读,可以先收藏抽空再细读:) 全 ...

  3. Swift - 给表格的单元格UITableViewCell添加图片,详细文本标签

    表格UITableView中,每一单元格都是一个UITableViewCell.其支持简单的自定义,比如在单元格的内部,添加图片和详细文本标签. 注意UITableViewCell的style: (1 ...

  4. c++(重载、覆盖、隐藏)

    源地址:http://www.cnblogs.com/qlee/archive/2011/07/04/2097055.html 成员函数的重载.覆盖与隐藏成员函数的重载.覆盖(override)与隐藏 ...

  5. 网络知识汇总(2) - Linux下如何修改ip地址

    在Linux的系统下如何才能修改IP信息   以前总是用ifconfig修改,重启后总是得重做.如果修改配置文件,就不用那么麻烦了-   A.修改ip地址   即时生效:   # ifconfig e ...

  6. 通过加载Kernel32来动态判断 当前操作系统32bit还是64bit

    工作原理:通过加载Kernel32来获取IsWow64Process 函数然后通过函数的地址操作,执行函数的操作. 在程序中只要我们获取了一个函数的地址,就可以找到正确的方法执行这个函数. 但是这种方 ...

  7. 步步为营Hibernate全攻略(四)剪不断理还乱之:复合主键 && 组合映射

    一:复合主键 复合主键即两个或多个字段联合起来作为主键,它的通常做法是将主键相关字段抽取出来放到一个单独的类中,但是这样的类是有要求的: 1.      必须实现序列化接口 2.      必须覆盖e ...

  8. IP Editor IP控件(对比一下封装IP控件)

    HWND hIpEdit; void __fastcall TForm2::FormCreate(TObject *Sender) { hIpEdit = CreateWindow(WC_IPADDR ...

  9. [C++]const修饰符

    Date: 2014-1-1 Summary: const 修饰符笔记 Contents: 1.const 修饰符 声明一个常量数据类型 , 在编译时就确定数据类型 2.const 与 指针 一般情况 ...

  10. GMM高斯混合模型学习笔记(EM算法求解)

    提出混合模型主要是为了能更好地近似一些较复杂的样本分布,通过不断添加component个数,能够随意地逼近不论什么连续的概率分布.所以我们觉得不论什么样本分布都能够用混合模型来建模.由于高斯函数具有一 ...