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

CSS Radio Button

CSS Radio Butt...

寫系統的時候三不五時總會用到Radio Button 和 Checkboxes 目前就在寫這個部份@...

判斷捲軸的位置

判斷捲軸的位置

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

將照片加入簽名檔

將照片加入簽名檔

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

Recommended reading

Other stories happened at this address

這麼冷的天就是要來碗麻油雞麵線

這麼冷的天就是要來碗麻油雞麵...

s 這麼冷的天,根本就不想出門( ̄∇ ̄) 搞定U的午餐後,自己煮了些麵線加上母親大人寄上來的麻油雞~...

HTML5 Geolocation

HTML5 Geolocat...

說真的,HTML Geolocation的功能真的好用... 輕鬆就可以讓網站也能取得目前所在的地理...

發現網路食客

發現網路食客

map 當電腦跟著你的日子越久~ 有時候會突然有些塵封已久的資料突然竄出( ̄∇ ̄) 發現~那年為了網...

5G看起來好像有美人尖哩~

5G看起來好像有美人尖哩~

G看起來好像有美人尖哩~

有沒有試過,被自己小孩叫醒的經驗?

有沒有試過,被自己小孩叫醒的...

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