Loading...

解決png圖檔GD合圖後背景色塊問題

Temperature: 0 °C

ChungChung
author_tools

重點在於設定圖片走透明通道~

$img = imagecreatefrompng($src);  
imagesavealpha($img,true);  
$thumb = imagecreatetruecolor(300,300);  
imagealphablending($thumb,false);//這裡很重要,意思是不合併顏色,直接用$img圖像顏色替換,包括透明色;
imagesavealpha($thumb,true); //這裡很重要,意思是不要丟了NewCanves圖像的透明色;
imagecopyresampled($thumb,$img,0,0,0,0,300,300,300,300);  
imagepng($thumb,"temp.png");

台北市內湖區江南街71巷75弄 Go

https://innstory.com/story-解決png圖檔GD合圖後背景色塊問題-503
寫程式筆記

Prev
 班長有什麼了不起我小學也當過班長

Next
屋簷上的秘密 

Nearby Attractions

台北市內湖區江南街71巷75弄-Nearby Attractions

  • 國立臺灣大學日式宿舍─翁通楹... Go
  • 司法大廈 Go
  • 臺北市政府衛生局舊址 Go
  • 前日軍衛戍醫院北投分院 Go
  • 原大阪商船株式會社臺北支店 Go
  • 臺北監獄圍牆遺蹟 Go

About the Author

Chung

我是chung
網路工作者
主業是網站系統開發建置
副業是做夢,寫故事
作品請參考/teme.biz
做夢請參考/innstory.com
聯絡/chung.teme@gmail.com

#有人用筆寫日記,有人用歲月寫日記,有人用照片寫日記,而我,用innstory寫日記。

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

瀏覽器升級ie9後FCKEditor無法使用對話框解決方法

瀏覽器升級ie9後FCKEd...

原文網址:http://ecshop.tw/bbs/archiver/tid.html 升級到 IE...

JavaScript 檢查 Radio Button

JavaScript 檢查 ...

要用 JavaScript 來檢查同一組的 radio button 是否已選,可用以下方法: if...

PHP數字轉國字...

PHP數字轉國字...

什麼鬼...客戶系統的需求竟然有一個數字要轉成國字.... 數字轉國字...數字轉國字...就是要把...

Recommended reading

Other stories happened at this address

嗯,聽說是在模仿小丸子的髮型...

嗯,聽說是在模仿小丸子的髮型...

嗯,聽說是在模仿小丸子的髮型...

獨自一個人的2個星期,最後幾個小時。

獨自一個人的2個星期,最後幾...

s 終於,獨自一個人的時間~只剩下最後幾個小時.....。 而本該要趕工的案子也差不多完成收尾~在號...

我們家提前過月亮節囉~

我們家提前過月亮節囉~

我們家提前過月亮節囉~

還是Chloe魅力無敵啊~

還是Chloe魅力無敵啊~

趁著兒子午睡,悄悄的把他懷中百味雜陳的Chloe送去洗澡~ 想說要過年了,也該清潔一下了。 怎知兒子...

櫻花樹下其實一點都不浪漫

櫻花樹下其實一點都不浪漫

a 以前,總覺得不管甚麼東西放在盛開的櫻花樹下,那種浪漫感覺是不可多得的時光。 自從車子停在浪漫的櫻...

街角的早餐店

街角的早餐店

習慣拎上一杯便利商店的冰咖啡,來到街角這間早餐店。 早餐店沒有名字,賣的是中式早餐。 喜歡上他的原因...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format