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

判斷捲軸的位置

判斷捲軸的位置

當捲軸往下移動時,判段目前移動到哪個位置... Javascript部份 $(function(){...

CSS3 box-shadow

CSS3 box-shado...

便利貼~俗稱小黃(對我來說),依據wiki的說法~是M公司的工程師史賓塞·席佛經過5年後出現成果。 ...

讓圖片上傳前先產生預覽

讓圖片上傳前先產生預覽

專案需要,上傳圖片至網站時先產生預覽圖~ 參考了stackoverflow.com裡討論的的方式

Recommended reading

Other stories happened at this address

唉…這傢伙非常怕寂寞啊~離開幾秒都不行@@

唉…這傢伙非常怕寂寞啊~離開...

唉…這傢伙非常怕寂寞啊~離開幾秒都不行@@

Android Studio 2.3 隨機改變背景顏色

Android Studio...

class 開始學習APP 其實我照著工具書上的方式總是在宣告變數時會產生問題~ 例如工具書上寫著可...

外頭下了一整天的雨,系統裡的天氣卻顯示我所在的位置陽光普照?何解?

外頭下了一整天的雨,系統裡的...

外頭下了一整天的雨,系統裡的天氣卻顯示我所在的位置陽光普照?何解?

發發來囉~還表演了很多才能哩!!非常厲害爬啊~

發發來囉~還表演了很多才能哩...

發發來囉~還表演了很多才能哩!!非常厲害爬啊~

6個月

6個月

已經個月了,從哇哇墜地到現在~看看U到底學會了什麼? 左翻右翻連續翻真的是沒有難度了 終於也是到了考...

5U要上學囉~

5U要上學囉~

U要上學囉~ 早上拿到書包就這樣背著一整天。 看起來是很開心,就是不知道等真正的那一天到來他會是甚麼...

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