PHP關於映像顏色的操作

來源:互聯網
上載者:User

1.imagecolorallocate

文法:int imagecolorallocate(int im,int red,int green,int blue)

該函數的功能是在im為表示的映像中設定RGB模式的顏色,傳回值為一個標識,這個標識唯一確定了一個在im映像的顏色,只有使用改函數指定到特定映像中的顏色才能被該映像使用,一個映像中所有實用的顏色都必須用這樣的方法來指定。而且一個映像不能使用另外一個映像中的顏色

2.imagecolortransparent

文法:int imagecolortransparent(int im[,int col])

該函數給映像指定透明的背景色,im為映像的標識,col為使用ImageColorAllocate函數給映像指定的顏色,傳回值為新指定的透明色的標識

3.imagecolorat

文法: int imagecolorat(int im,int x,int y)

該函數可以取得映像中的點源素的顏色值。參數im為圖形的標識,x和Y分別為映像中的點所在的位置的橫座標和縱座標

4.imagecolorclosest

文法:int imagecolorclosest(int im,int red,int green,int blue)

該函數可以計算給定的映像中某點的顏色和哪個顏色的索引值最接近,參數im為映像的標識。

5.imagecoloeset

文法:bool imagecolorset(int im,int index,int red,int green,int blue)

該函數可以設定映像的色彩索引表中指定索引的顏色 。index為指定的索引號

6.imagecolorsforindex

文法:array imagecolorsforindex(int im,int index)

該函數從映像的元素索引表中根據索引號取得指定的顏色

7.imagecolorstotal

文法:int imagecolorstotal(int im)

該函數能探測映像總共使用了多少種顏色

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.