當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。