PHP圖形處理函數試題

來源:互聯網
上載者:User

標籤:

一.問答題

1.取得當前安裝的 GD 庫的資訊的函數是?

2.取得映像大小的函數是?

3.為一幅映像分配顏色 + alpha的函數是?

4.建立一個基於調色盤的映像的函數是?

5.建立一個黑色映像的函數是?

6.用給定角度旋轉映像的函數是?

7.水平地畫一行字串的函數是?

8.載入一新字型的函數是?

9.取得某像素的色彩索引值的函數是?

 

二.編程題

請畫出下列圖片

 

 

 

答案:

一.問答題

1.array gd_info ( void )

2.array getimagesize ( string $filename [, array &$imageinfo ] )

3.int imagecolorallocatealpha ( resource $image , int $red , int $green , int $blue , int $alpha )

  第一次對 imagecolorallocatealpha() 的調用會給基於調色盤的映像填充背景色,即用 imagecreate() 建立的映像

4.resource imagecreate ( int $x_size , int $y_size )

5.resource imagecreatetruecolor ( int $width , int $height )

6.resource imagerotate ( resource $image , float $angle , int $bgd_color [, int$ignore_transparent = 0 ] )

7.bool imagestring ( resource $image , int $font , int $x , int $y , string $s , int $col )

   如果 font 是 1,2,3,4 或 5,則使用內建字型

8.int imageloadfont ( string $file )

9.int imagecolorat ( resource $image , int $x , int $y )

二.編程題

圖一

<?php$image = imagecreatetruecolor(200, 200);// 分配一些顏色$white    = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);$gray     = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);$darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90);$navy     = imagecolorallocate($image, 0x00, 0x00, 0x80);$darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50);$red      = imagecolorallocate($image, 0xFF, 0x00, 0x00);$darkred  = imagecolorallocate($image, 0x90, 0x00, 0x00);// 建立 3D 效果for ($i = 110; $i > 100; $i--) {   imagefilledarc($image, 100, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE);   imagefilledarc($image, 100, $i, 100, 50, 45, 75 , $darkgray, IMG_ARC_PIE);   imagefilledarc($image, 100, $i, 100, 50, 75, 360 , $darkred, IMG_ARC_PIE);}imagefilledarc($image, 100, 100, 100, 50, 0, 45, $navy, IMG_ARC_PIE);imagefilledarc($image, 100, 100, 100, 50, 45, 75 , $gray, IMG_ARC_PIE);imagefilledarc($image, 100, 100, 100, 50, 75, 360 , $red, IMG_ARC_PIE);// 輸出映像header(‘Content-type: image/png‘);imagepng($image);imagedestroy($image);

 

PHP圖形處理函數試題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.