[請益] 圖片合成

看板PHP作者 (麥芽糖N  ﳿ︠)時間17年前 (2008/11/11 15:51), 編輯推噓2(205)
留言7則, 2人參與, 最新討論串1/2 (看更多)
想請問板上高手 目前我有photo1, photo2, photoframe 三張圖 我現在要把photo1, photo2 塞入 photoframe 這張底圖挖空的部份 但是不管我怎麼做 photo2 會把 photo1 覆蓋過去 意思就是 photo1 那個挖空的位置會變成一片黑,想要麻煩板上高手替我看一下 以下為程式碼: <? // File and rotation $degrees1 = 18; $degrees2 = -12; //photo1 //***************************************************************************************** $photo1 = imagecreatefromjpeg('1139817060.jpg'); $fotoW1 = 172; $fotoH1 = 132; // Rotate $test = imagecreatetruecolor($fotoW1,$fotoH1); imagecopyresampled($test, $photo1, 0, 0, 0, 0, $fotoW1, $fotoH1, imagesx($photo1), imagesy($photo1)); $photo1 = imagerotate($test, $degrees1, 0); //***************************************************************************************** //photo2 //***************************************************************************************** $photo2 = imagecreatefromjpeg('1139817060.jpg'); $fotoW2 = 172; $fotoH2 = 132; // Rotate $test = imagecreatetruecolor($fotoW2,$fotoH2); imagecopyresampled($test, $photo2, 0, 0, 0, 0, $fotoW2, $fotoH2, imagesx($photo2), imagesy($photo2)); $photo2 = imagerotate($test, $degrees2, 0); //***************************************************************************************** $photoFrame = imagecreatefrompng('11.png'); $logoImage = imagecreatefrompng('001(1).png'); imagecopy($photoFrame, $photo1, 0, 0, -240, -143, 800, 600); imagecopy($photoFrame, $photo2, 0, 0, -470, -310, 800, 600); $logoW = imagesx($logoImage); $logoH = imagesy($logoImage); imagecopy($photoFrame, $logoImage, 0, 0, 0, 0, $logoW, $logoH); imagepng($photoFrame,'',9); ?> 請指教...謝謝... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.21.120.81

11/11 16:38, , 1F
這要看你的圖檔是怎麼做的.如果本來挖空部分不是
11/11 16:38, 1F

11/11 16:38, , 2F
透明處理..程式怎麼做都會蓋掉第一張圖挖空的部份
11/11 16:38, 2F

11/11 16:44, , 3F
喔 有透明處理 但是photo1&photo2 似乎都王不見王
11/11 16:44, 3F

11/11 16:44, , 4F
請問跟旋轉圖片有關係嗎??
11/11 16:44, 4F

11/11 16:50, , 5F
如果是已經透明處理了應該直接套上就可以了
11/11 16:50, 5F

11/11 16:56, , 6F
11/11 16:56, 6F

11/11 16:57, , 7F
我也不知道為什麼就是不行><
11/11 16:57, 7F
文章代碼(AID): #196JcHXG (PHP)
討論串 (同標題文章)
文章代碼(AID): #196JcHXG (PHP)