Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 17 su 17

Discussione: imagecopymerge

  1. #11
    Utente di HTML.it L'avatar di polinet
    Registrato dal
    Nov 2000
    Messaggi
    993
    l'immagine del ciclo while per quel record.

    $query_limit = mysql_query("SELECT * FROM tbl order by id_pro DESC LIMIT $primo, $per_page");
    while ($riga = mysql_fetch_array( $query_limit ) )

    {
    echo("<table border=0 cellspacing=0 width=340 style=border-collapse:collapse>"); echo("<tr>");
    echo("<td width=340 style=padding-left:0px>");

    echo("<table width=340 height=200 border=0 background=img/sfondo_menu.gif style=background-repeat:no-repeat>");
    echo("<tr>");
    echo("<td width=150>");

    //tabella foto home
    echo("<table width=150 border=0>");
    echo("<tr>");
    if ($riga["watermark"] == "on")
    {

    $image = "<img src=office/admin_office/img/". $riga["foto1p"] ." border=1>";
    $overlay = "<img src=img/affittato.gif>";
    //echo $image;
    if (!file_exists($image))
    {
    die("Image does not exist.");
    echo "
    ";
    }
    $w_offset = 0;
    $h_offset = 0;
    $extension = strtolower(substr($image, strrpos($image, ".") + 1));
    switch ($extension)
    {
    case 'jpg':
    $background = imagecreatefromjpeg($image);
    break;
    case 'jpeg':
    $background = imagecreatefromjpeg($image);
    break;
    case 'png':
    $background = imagecreatefrompng($image);
    break;
    case 'gif':
    $background = imagecreatefromgif($image);
    break;
    default:
    die("Image is of unsupported type.");
    }
    $swidth = imagesx($background);
    $sheight = imagesy($background);
    imagealphablending($background, true);
    $overlay = imagecreatefrompng($overlay);
    $owidth = imagesx($overlay);
    $oheight = imagesy($overlay);
    imagecopy($background, $overlay, $swidth - $owidth - $w_offset, $sheight - $oheight - $h_offset, 0, 0, $owidth, $oheight);
    header("Content-type: image/jpeg");
    header("Content-Disposition: filename=" . $image);
    imagepng($background);
    imagedestroy($background);
    imagedestroy($overlay);


    //ora qui poi devo stampare l'immagine "fusa"


    }else{

    echo("<td rowspan=7 align=center style=padding-left:25px;padding-top:0px>");
    echo("<img src=office/admin_office/img/". $riga["foto1p"] ." border=1> ");
    echo("</td>");
    }
    }


    è che è la prima volta che affronto un argomento simile... sono un po spaesato.

    dove sbaglio?

    GRAZIE MILLE!!!
    ¿Hasta la pasta?

  2. #12
    Utente di HTML.it L'avatar di Gunn
    Registrato dal
    Feb 2006
    Messaggi
    370
    insisto
    COSA C'E' ESATTAMENTE in $riga["foto1p"];?

  3. #13
    Utente di HTML.it L'avatar di polinet
    Registrato dal
    Nov 2000
    Messaggi
    993
    è un campo del DB.

    esattamente ora nel id_pro 89 si trova: villa_p.jpg
    ¿Hasta la pasta?

  4. #14
    Utente di HTML.it L'avatar di polinet
    Registrato dal
    Nov 2000
    Messaggi
    993
    UP
    ¿Hasta la pasta?

  5. #15
    Utente di HTML.it L'avatar di Gunn
    Registrato dal
    Feb 2006
    Messaggi
    370
    ma nel db è memorizzato cosa, l'immagine, il nome del file...?

  6. #16
    Utente di HTML.it L'avatar di polinet
    Registrato dal
    Nov 2000
    Messaggi
    993
    il nome del file.

    Comunque ho risolto cosi:

    nel background della tabella metto la foto, e nel <td> l'immagine

    sempre a seconda della condizione.


    GRAZIE!!!!!!!

    se vuoi vedere il risultato mandami un PVT che ti passo URL

    CIAO
    ¿Hasta la pasta?

  7. #17
    Originariamente inviato da Gunn
    prova a modificare questo, supporta anche il canale alpha delle png

    <?php
    $image = "test.png";
    $overlay = 'test2.png';
    if (!file_exists($image)) {
    die("Image does not exist.");
    }
    $w_offset = 0;
    $h_offset = 0;
    $extension = strtolower(substr($image, strrpos($image, ".") + 1));
    switch ($extension)
    {
    case 'jpg':
    $background = imagecreatefromjpeg($image);
    break;
    case 'jpeg':
    $background = imagecreatefromjpeg($image);
    break;
    case 'png':
    $background = imagecreatefrompng($image);
    break;
    case 'gif':
    $background = imagecreatefromgif($image);
    break;
    default:
    die("Image is of unsupported type.");
    }
    $swidth = imagesx($background);
    $sheight = imagesy($background);
    imagealphablending($background, true);
    $overlay = imagecreatefrompng($overlay);
    $owidth = imagesx($overlay);
    $oheight = imagesy($overlay);
    imagecopy($background, $overlay, $swidth - $owidth - $w_offset, $sheight - $oheight - $h_offset, 0, 0, $owidth, $oheight);
    header("Content-type: image/jpeg");
    header("Content-Disposition: filename=" . $image);
    imagepng($background);
    imagedestroy($background);
    imagedestroy($overlay);
    ?>
    ho provato questo script, funziona perfettamente, ma come posso estrarre una variabile e togliere l'header??

    Io dovrei fare tutto ciò, ma non dovrei far visualizzare l'immagine e dovrei poter avere una variabile da copiare in una cartella e inserire il valore in un database.

    es:

    $fotouppata
    fotodasovrapporre.png

    ....
    ...
    $nuovafotomodificata


    come fare?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.