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


PHP SimpleImage::cutFromCenter方法代码示例

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


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

示例1: CapaCurso

 public function CapaCurso($id, $capa, $cliente)
 {
     $vai = new MySQLDB();
     $sql = "SELECT `capa` FROM `curso` WHERE `idcurso` = {$id};";
     $vai = new MySQLDB();
     $result = $vai->ExecuteQuery($sql);
     $objeto = mysql_fetch_object($result);
     if ($objeto->capa != "../../img/sem_imagem.gif") {
         @unlink("{$objeto->capa}");
     }
     if (empty($capa['name'])) {
         $nova_capa = "../../img/sem_imagem.gif";
     } else {
         $nome_original = $capa['name'];
         list($nome_arquivo, $extensao_arquivo) = explode(".", $nome_original);
         $ds90 = str_replace(" ", "_", $nome_arquivo);
         $numero_reg = rand(1, 999);
         $nome_aleatorio_arquivo = $ds90 . $numero_reg;
         $nova_capa = "../../img/" . $nome_aleatorio_arquivo . "." . $extensao_arquivo;
         if (!move_uploaded_file($capa['tmp_name'], "./{$nova_capa}")) {
             $erro .= "Erro no envio da imagem.<br />";
             header("Location: curso.php?vi=erroe&error={$erro}&ed={$cliente}");
         } else {
             include "../../plugins/SimpleImage/SimpleImage.php";
             $image = new SimpleImage();
             $image->load($nova_capa);
             $image->cutFromCenter(270, 200);
             $image->save($nova_capa);
         }
     }
     $sql = "UPDATE `curso` SET `capa`='{$nova_capa}' WHERE `idcurso`={$id};";
     $vai->executeQuery($sql);
     header("Location: curso.php?vi=edit&nu={$id}&ed={$cliente}");
 }
开发者ID:GlauberF,项目名称:Portal-curso-Online,代码行数:34,代码来源:curso.class.php

示例2: RECORTE

 public function RECORTE($id_media, $id)
 {
     $sql = "SELECT `endereco_media` FROM `media` WHERE `id_media` = {$id_media};";
     $vai = new MySQLDB();
     $result = $vai->ExecuteQuery($sql);
     $objeto = mysql_fetch_object($result);
     $action2 = $objeto->endereco_media;
     $imagem = "../../../" . $action2;
     include "../../plugins/SimpleImage/SimpleImage.php";
     $image = new SimpleImage();
     $image->load($imagem);
     $x2 = $centreX + 870;
     $y2 = $centreY + 420;
     $image->cutFromCenter(870, 420);
     $image->save($imagem);
     header("refresh:0; url=media.php?vi=recorte&nu={$id}");
 }
开发者ID:GlauberF,项目名称:Portal-curso-Online,代码行数:17,代码来源:media.class.php


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