当前位置: 首页 > news >正文

广发证券 网站谁做的注册网站怎么做

广发证券 网站谁做的,注册网站怎么做,0基础学做网站教程,德州做网站公司需求描述#xff1a;需要把图片裁剪成一个指定的平行四边形#xff0c;目的是使用GD库#xff0c;把裁剪后的图片放在底图上面#xff0c;使最终合成的图片看起来是一个底图平行四边形的样子提示#xff1a;可以结合本作者的其他文章#xff0c;来生成一个定制化的海报需要把图片裁剪成一个指定的平行四边形目的是使用GD库把裁剪后的图片放在底图上面使最终合成的图片看起来是一个底图平行四边形的样子提示可以结合本作者的其他文章来生成一个定制化的海报到此为止定制化海报生成的所有知识点就写完了大家可以自己看看那部分是自己需要可以自己获取相应部分解决方案第一步便是生成矩形的图片但是经过测试后发现无论是使用GD库还是使用PS最终的图片还是一个矩形并不能真正的实现把图片裁剪成为自己想要的形状那么一种方案行不通那就换成另外一种方案使用遮蔽物遮挡把图片变成我们想要的形状比如左边的三角形和右边的三角形这两个形状就是使用imagefilledpolygon函数绘制填充的多边形来填充最终获取到想要的图案示例图 //图片像素点 public function pixels(){ $imgpath 地址; $image $this-createImageFromFile($imgpath); //定位(左边渲染块) $values array( 0, 0, // Point 1 (x, y) 0, 420, // Point 2 (x, y) 100, 0 // Point 3 (x, y) ); //获取颜色 $gr imagecolorallocate($image, 228, 251, 255); imagefilledpolygon($image, $values, 3, $gr); //定位(右边渲染块) $values array( 420, 420, 420, 0, 320, 420 ); $gr imagecolorallocate($image, 228, 251, 255); imagefilledpolygon($image, $values, 3, $gr); header(Content-type:image/png); imagepng($image); } //获取图片类型,从字符串中的图像流新建一图像:非本地图片获取图像流生成本地图片 function createImageFromFile($file) { if (preg_match(/http(s)?:\/\//, $file)) { $fileSuffix $this-getNetworkImgType($file); } else { $fileSuffix pathinfo($file, PATHINFO_EXTENSION); } if (!$fileSuffix) return false; switch ($fileSuffix) { case jpeg: if (!strpos($file, qnimg.ruwii.com) !strpos($file, upload)) { // imagecreatefromstring:从字符串中的图像流新建一图像, 返回一个图像标识符其表达了从给定字符串得来的图像 $theImage imagecreatefromstring($this-http_get_data($file)); } else { $theImage imagecreatefromjpeg($file); if (!$theImage) { $theImage imagecreatefromstring($this-http_get_data($file)); } } break; case jpg: if (!strpos($file, qnimg.ruwii.com) !strpos($file, upload)) { $theImage imagecreatefromstring($this-http_get_data($file)); } else { $theImage imagecreatefromjpeg($file); if (!$theImage) { $theImage imagecreatefromstring($this-http_get_data($file)); } } break; case png: if (!strpos($file, qnimg.ruwii.com) !strpos($file, upload)) { $theImage imagecreatefromstring($this-http_get_data($file)); } else { $theImage imagecreatefrompng($file); if (!$theImage) { $theImage imagecreatefromstring($this-http_get_data($file)); } } break; case gif: if (!strpos($file, qnimg.ruwii.com) !strpos($file, upload)) { $theImage imagecreatefromstring($this-http_get_data($file)); } else { $theImage imagecreatefromgif($file); if (!$theImage) { $theImage imagecreatefromstring($this-http_get_data($file)); } } break; default: $theImage imagecreatefromstring($this-http_get_data($file)); break; } return $theImage; } //获取图片类型 private function getNetworkImgType($url) { $ch curl_init(); //初始化curl curl_setopt($ch, CURLOPT_URL, $url); //设置需要获取的URL curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);//设置超时 curl_setopt($ch, CURLOPT_TIMEOUT, 3); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //支持https curl_exec($ch);//执行curl会话 $http_code curl_getinfo($ch);//获取curl连接资源句柄信息 curl_close($ch);//关闭资源连接 if ($http_code[http_code] 200) { $theImgType explode(/, $http_code[content_type]); if ($theImgType[0] image) { return $theImgType[1]; } else { return false; } } else { return false; } } //获取远程图片 function http_get_data($url) { $ch curl_init(); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, GET); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_URL, $url); ob_start(); curl_exec($ch); $return_content ob_get_contents(); ob_end_clean(); curl_getinfo($ch, CURLINFO_HTTP_CODE); return $return_content; }
http://www.w-s-a.com/news/261278/

相关文章:

  • jq网站特效插件如何知道网站是否被k
  • 自己的网站怎么接广告网站搭建收费
  • 宁波大型网站制作建立一个网站 优帮云
  • 大连零基础网站建设教学电话有哪些比较好的做ppt好的网站
  • 哪个网站做logo设计我的建筑网
  • php电子商务网站开发沂源手机网站建设公司
  • html和php做网站哪个好3gcms企业手机网站整站源码asp
  • 网站建设网页设计案例云南建设厅网站删除
  • 杏坛网站制作太原做网站要多少钱呢
  • 做新闻类网站还有市场吗东莞黄页网广告
  • 地方网站做外卖专业做互联网招聘的网站有哪些
  • 网站推广公司兴田德润紧急网页升级紧急通知
  • 厦门做网站哪家强企业网站网页设计的步骤
  • 普拓网站建设济南行业网站建设
  • 燕郊 网站开发网站里的地图定位怎么做
  • 门户网站建设招标互联网创业项目概述
  • 用什么做网站比较好市场调研公司是做什么的
  • 电商网站充值消费系统绍兴网站优化
  • 深圳网站建设公司联虚拟币交易网站开发
  • 专业网站设计建设公司抖音代运营公司排名前十强
  • 做网站架构肃北蒙古族自治县建设局网站
  • 推广网站怎么建经济研究院网站建设方案
  • 网站建设商家淘宝客自建网站做还是用微信qq做
  • django做网站效率高吗涉县移动网站建设报价
  • 做外贸网站注册什么邮箱能够做渗透的网站
  • 购物网站 怎么做织梦网站会员功能
  • 北京市网站开发公司郑州联通网站备案
  • 温岭专业营销型网站建设地址wordpress小程序怎么不用认证审核
  • 网站建设主体设计要求微信公众号缴费
  • 网站建设的税率WordPress多用户建站