Php imagecopy paremeters problem

Discussion in 'PHP' started by erkin0007, Jun 9, 2013.

  1. #1
    I set the size of the pictures as I want but imagecopy function spoils it. I want the upper picture's width to be same as the lower pisture's and put under the upper picture
     
    Last edited: Jun 9, 2013
    erkin0007, Jun 9, 2013 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    And what do you want us to do?
     
    nico_swd, Jun 9, 2013 IP
  3. erkin0007

    erkin0007 Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    i want to imagecopy paremeters.
    i want to this.paremeters. the black is one picture .red is two picture
    [​IMG]
     
    erkin0007, Jun 9, 2013 IP
  4. aidanriley629

    aidanriley629 Banned

    Messages:
    429
    Likes Received:
    23
    Best Answers:
    3
    Trophy Points:
    175
    #4
    We need to see your code.
     
    aidanriley629, Jun 10, 2013 IP
  5. erkin0007

    erkin0007 Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    my code is mixed.i am so sorry
    <?php
    echo'    <form action="" method="post" enctype="multipart/form-data">
          <input type="text" name="yazi">
          <input type="file" name="resim" id="resim">
          <input type="submit" value="gonder">
            </form>';
          $yazi=$_POST['yazi'];
            if(isset($_POST['yazi'])){
           
            $resim=$_POST['resim'];
            $yazi=$_POST['yazi'];
            $resimadi=$_FILES['resim']['name'];
            $geciciyol=$_FILES['resim']['tmp_name'];
            $dosyayolu="resimler/$resimadi";
            move_uploaded_file($geciciyol,$dosyayolu);
            sleep(2);
            $enboy=getimagesize($dosyayolu);
            $boy=$enboy[0];
            $en=$enboy[1];
    $resimadi=explode('.',$resimadi);
           
    $resim = imagecreate($en, $boy*25/100);
    $arkaplan = imagecolorallocate($resim, 250, 0, 0);//renkler
    $yazirengi = imagecolorallocate($resim, 0, 0, 0);
    imagestring($resim, 454, 0,5 , "$yazi", $yazirengi);//ikinci parametre saga dogru 3.ise asaga dogru çekiyor.
    imagepng($resim,"resimler/rsm$resimadi[0].png");
    sleep(2);
    imagedestroy($resim);
     
     
     
    //header("content-type: image/jpeg");
     
    $first=imagecreatefromjpeg("resimler/$resimadi[0].jpg");        #First
    $second=imagecreatefrompng("resimler/rsm$resimadi[0].png");#Second
    //This creates the two images that use
     
    #An image on the other
    imagecopy($first,$second,0,0,0,0,0,0); //<-- Coordinates
     
    #}...
    imagejpeg($first,'resimler/ikiresmibirlestirdik.jpg');
     
    #Destroy both!
    imagedestroy($first);
    sleep(2);
    imagedestroy($second);
     
    }
    ?>
    PHP:
     
    erkin0007, Jun 10, 2013 IP
  6. aidanriley629

    aidanriley629 Banned

    Messages:
    429
    Likes Received:
    23
    Best Answers:
    3
    Trophy Points:
    175
    #6
    Do you only want two pictures? Why are you using imagecopy and imagejpeg?
     
    aidanriley629, Jun 10, 2013 IP
  7. erkin0007

    erkin0007 Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    yes i want to only 2 images
    image jpeg is for save to result.
    imagecopy is for mixed to images
     
    erkin0007, Jun 10, 2013 IP
  8. aidanriley629

    aidanriley629 Banned

    Messages:
    429
    Likes Received:
    23
    Best Answers:
    3
    Trophy Points:
    175
    #8
    ok, what are the dimensions of the original 2 images?
     
    aidanriley629, Jun 10, 2013 IP
  9. erkin0007

    erkin0007 Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    dimensions are variable.user is detect to dimensions.
    examle
    1.image 700*300
    2.image 700*25/100 * 300
     
    erkin0007, Jun 10, 2013 IP
  10. aidanriley629

    aidanriley629 Banned

    Messages:
    429
    Likes Received:
    23
    Best Answers:
    3
    Trophy Points:
    175
    #10
    I think the problem is that you need to put the correct coordinates in the imagecopy function.
     
    aidanriley629, Jun 10, 2013 IP
  11. erkin0007

    erkin0007 Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #11
    thank you so much for helps
    already I want to true coordinates.i don't found true coordinates
     
    erkin0007, Jun 10, 2013 IP
  12. aidanriley629

    aidanriley629 Banned

    Messages:
    429
    Likes Received:
    23
    Best Answers:
    3
    Trophy Points:
    175
    #12
    How big do you want each image to be?
     
    aidanriley629, Jun 10, 2013 IP
  13. erkin0007

    erkin0007 Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #13
    already i set to size 1.image and 2.image.but image copy function is disrupt.
    my engilish is bad.i am sorry
     
    erkin0007, Jun 10, 2013 IP
  14. aidanriley629

    aidanriley629 Banned

    Messages:
    429
    Likes Received:
    23
    Best Answers:
    3
    Trophy Points:
    175
    #14
    aidanriley629, Jun 10, 2013 IP
  15. erkin0007

    erkin0007 Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #15
    i dodge this program.
    thank you so much aidanriley629
     
    Last edited: Jun 10, 2013
    erkin0007, Jun 10, 2013 IP