Exemple #1
0
 public function __construct($imagem = '')
 {
     if (!empty($imagem)) {
         $this->extensao = $imagem->extensao;
         $this->nome = $imagem->nome;
         $this->url = $imagem->url;
         $this->imagem = $imagem;
     } else {
         parent::__construct(1, 1);
     }
 }
$p = $lP->condicoes('', $_GET['produto'], ListaProdutos::ID)->disableDadosProdutoPai()->listar();
if (isset($_GET['uploadFlash'])) {
    $con = BDConexao::__Abrir();
    $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "marcadagua");
    $rs = $con->getRegistro();
    $img = new Imagem();
    $img->setSessao($lP->getTabela(), $p->getId());
    $arq = Arquivos::__OpenArquivoByTEMP($_FILES['Filedata']);
    //header("Content-type: image/jpeg");
    $img->setImage(new Image($arq));
    $img->getImage()->open();
    //echo $img->getImage()->getImage();exit;
    if ($rs['produtos']) {
        if ($rs['tipo'] == 1) {
            if (!empty($rs['texto'])) {
                $ma = new NewImage(strlen($rs['texto']) * 9, 20);
                $ma->writeText($rs['texto']);
            }
        } elseif ($rs['tipo'] == 2) {
            if (!empty($rs['imagem'])) {
                $ma = new Image(new Arquivos(Sistema::$caminhoURL . Sistema::$caminhoDataIdiomas . $rs['imagem']));
                $ma->open();
                //echo $ma->getImage();exit;
            }
        }
        if ($ma) {
            if ($rs['posicaohorizontal'] == 1) {
                $x = 0;
            } elseif ($rs['posicaohorizontal'] == 2) {
                $x = $img->getImage()->largura / 2 - $ma->largura / 2;
            } elseif ($rs['posicaohorizontal'] == 3) {
Exemple #3
0
 public function cutImage($w, $h, $x = 0, $y = 0)
 {
     $img = new NewImage($w, $h);
     $img->combineImage($this, $x, $y);
     return $img;
 }