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

PHP使用GD函數切正方形圖像

PHP使用GD函數切正方形圖...

基本上大都是等比例將圖片上傳.... 但有時也會有需要正方形邊長的圖像需求 這時候還是得靠GD函式了...

PHP 時間時區修正

PHP 時間時區修正

一般來說...PHP取得的時間,是格林威治的時間: 但如果要將時間調成臺灣的時區,或其他時區的話,必...

javascript 底下使用 htmlspecialchars

javascript 底下使...

pexelsphoto Javascript中使用一個函數達到PHP的htmlspecialchar...

Recommended reading

Other stories happened at this address

Apache無法執行.htaccess?

Apache無法執行.hta...

pexelsphoto 首先.htaccess是在Apache HTTP Server服務器架設下,...

下一站,父親。

下一站,父親。

i 我無法掩飾我內心的喜悅... 為了等待你的到來,我跟你媽媽也歷經了數個年頭的等待、期待... 因...

8個月,會叫叭~叭~叭~

8個月,會叫叭~叭~叭~

八個月的U,明顯大隻了很多。 會叭~叭~叭的發出聲音~我可以自我感覺良好的認為他是在叫我爸爸嗎?( ̄...

是說我的好日子快到了嗎???

是說我的好日子快到了嗎???...

個多月的U,目前喝奶方式已經進階到可以自己握著奶瓶~ 恩,是說我的好日子快到了嗎???

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

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

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

獨自一個人的2個星期,第4晚,還好有屏東帶回來的三層肉(蔥爆蕃茄豬肉片)。

獨自一個人的2個星期,第4晚...

s 其實,從昨晚我就已經知道今天晚上要炒個豬肉片來當晚餐。 說實在的,以往單身的日子我鮮少自己下廚。...

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