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

恭喜

恭喜

5U個性比較文靜對於一些活動並不會主動積極的參與。 這回,在Mandy的鼓勵下,他參加了班上的說故事...

JavaScript的獲取日期代碼不足兩位數補0

JavaScript的獲取日...

當我們用javascript得到了一個時間後...針對月份及日期的部分只會顯示數字... funct...

黑客松Hackathon(二)

黑客松Hackathon(二...

這是一次不同的體驗... 我一直都渴望有所謂的工作團隊並且享受共同討論共同創作的樂趣... 這次在黑...

Recommended reading

Other stories happened at this address

聽說今天是父親節啊~

聽說今天是父親節啊~

給U吃餅乾~ 結果他把餅乾弄碎了給我當痱子粉抹在身上.... 現在整個身體倒是充滿了千層鬆塔的甜味....

When caterpillar grow up become butterfly

When caterpill...

When caterpillar grow up become butterfly

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

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

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

我的第一次父親節,這傢伙卻只對蛋糕有興趣~

我的第一次父親節,這傢伙卻只...

年月日 終於,我確確實實的在過著父親節了。 雖然U還小,無法趁這機會帶他出去過節~ 在家裡,其實也挺...

ajax防止重複提交

ajax防止重複提交

會發生重提交的原因,大致上是因為考驗人與系統間的耐性~ AJAX(非同步的JavaScript與XM...

5U脫逃記,哥要的是自由啊~

5U脫逃記,哥要的是自由啊~...

Mandy為了小傢伙添購了一個籠(安全柵欄)。 s 也在我充滿設計感的眼光下拼裝完成~ 為的是希望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