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

動態留言功能調整

動態留言功能調整

guestmap55 最近改進了朋友動態的發文方式.... 一開始在功能方面加上了googlemap...

Mysql查詢特定欄位相乘總合

Mysql查詢特定欄位相乘總...

最近常常會用到的查詢方式... 問題是這樣的,我有一個資料表內容結構如下: +++++ | id |...

PHP自動補零!!

PHP自動補零!!

其實這個是基礎中的基礎....但我卻老是不願意記起來他的函式用法..@@ 剛剛..又用到了...啊所...

Recommended reading

Other stories happened at this address

CSS3 box-shadow

CSS3 box-shado...

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

屬於自己的片刻

屬於自己的片刻

s 外頭下著雨。 Mandy跟U都已入睡~我卻捨不得入眠。 自從U的到來,照顧著這傢伙,說真的幾乎已...

啊~是在拍我嗎?

啊~是在拍我嗎?

啊~是在拍我嗎?

innstory首頁設計

innstory首頁設計

年,再次幫Innstory換上了新版的首頁。 這次使用了bootstrap RWD 設計。 Boot...

挺進7個月囉~

挺進7個月囉~

個月了~最近開始偶爾會腳抽筋,所以鈣的部份得多補充了.... 而且小傢伙在Mandy肚子裡好像工程越...

將照片加入簽名檔

將照片加入簽名檔

我始終相信,科技來自於人性... 而我的人性則是來自於墮性.... 開發 innstory.com ...

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