当前位置: 首页>>代码示例>>PHP>>正文


PHP Library::getFileObjectFromContents方法代码示例

本文整理汇总了PHP中Library::getFileObjectFromContents方法的典型用法代码示例。如果您正苦于以下问题:PHP Library::getFileObjectFromContents方法的具体用法?PHP Library::getFileObjectFromContents怎么用?PHP Library::getFileObjectFromContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Library的用法示例。


在下文中一共展示了Library::getFileObjectFromContents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: runImage

 protected function runImage($action)
 {
     $this->width = $action['width'];
     $this->height = $action['height'];
     $fileobject = Library::getFileObjectFromContents($action['contents']);
     include_once 'GIFSplit.php';
     $gif = new GIFSplit($fileobject);
     $this->frames = $gif->frames;
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:9,代码来源:BackgroundGIF.php

示例2: setFrames

 protected function setFrames()
 {
     foreach ($this->background->frames as $framekey => $frame) {
         if ($framekey === 0 || $frame['disposalmethod'] === '010' || $this->background->frames[$framekey - 1]['disposalmethod'] === '010') {
             $resource = imagecreatetruecolor($this->background->width, $this->background->height);
             if (isset($this->fill) === true) {
                 $backgroundindex = imagecolorallocate($resource, $this->fill['red'], $this->fill['green'], $this->fill['blue']);
                 imagefill($resource, 0, 0, $backgroundindex);
             } else {
                 $backgroundindex = imagecolorallocatealpha($resource, 255, 255, 255, 127);
                 imagefill($resource, 0, 0, $backgroundindex);
                 imagecolortransparent($resource, $backgroundindex);
             }
             imagecopy($resource, $frame['resource'], 0, 0, 0, 0, $this->background->width, $this->background->height);
             if (isset($this->layersresource) === true) {
                 imagecopy($resource, $this->layersresource, 0, 0, 0, 0, $this->background->width, $this->background->height);
             }
         } else {
             $resource = imagecreatetruecolor($this->background->width, $this->background->height);
             $transparentindex = imagecolorallocatealpha($resource, 255, 255, 255, 127);
             imagefill($resource, 0, 0, $transparentindex);
             imagecolortransparent($resource, $transparentindex);
             imagecopy($resource, $frame['resource'], 0, 0, 0, 0, $this->background->width, $this->background->height);
             if (isset($this->layersresource) === true) {
                 if (isset($this->layerscoordinates) === false) {
                     $this->setLayersCoordinates();
                 }
                 imagealphablending($resource, false);
                 foreach ($this->layerscoordinates as $layerscoordinate) {
                     imagesetpixel($resource, $layerscoordinate['x'], $layerscoordinate['y'], $transparentindex);
                 }
             }
         }
         $this->frames[$framekey]['disposalmethod'] = $frame['disposalmethod'];
         $this->frames[$framekey]['delaytime'] = $frame['delaytime'];
         $contents = Library::getContentsFromGDResource($resource, 'gif');
         $this->frames[$framekey]['fileobject'] = Library::getFileObjectFromContents($contents);
     }
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:39,代码来源:OutputGIF.php


注:本文中的Library::getFileObjectFromContents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。