PHP Code Draw football field

Source: Internet
Author: User

drew a football field in code.

Original:

Code to draw out:

The code is as follows:

//Create an image of 200X200$img= Imagecreate (800, 500);//Assigning Colors$BG= Imagecolorallocate ($img, 0, 120, 0);$white= Imagecolorallocate ($img, 255, 255, 255);$black= Imagecolorallocate ($img, 0, 0, 0);//Fill Background ColorImagefill ($img, 800, 500,$BG);//Draw Line// four-sidedImageline ($img, 25, 25, 775, 25,$white); Imageline ($img, 25, 475, 775, 475,$white); Imageline ($img, 25, 25, 25, 475,$white); Imageline ($img, 775, 25, 775, 475,$white);//Middle Split LineImageline ($img, 400, 25, 400, 475,$white);//points in pointImagesetpixel ($img, 400, 250,$white); Imagesetpixel ($img, 399, 250,$white); Imagesetpixel ($img, 401, 250,$white); Imagearc ($img, 400, 250, 4, 4, 0, 360,$white);//mid-Split CircleImagearc ($img, 400, 255, 150, 150, 0, 360,$white);//left goalImageline ($img, 25, 175, 65, 175,$white); Imageline ($img, 25, 325, 65, 325,$white); Imageline ($img, 65, 175, 65, 325,$white); Imageline ($img, 25, 105, 155, 105,$white); Imageline ($img, 25, 395, 155, 395,$white); Imageline ($img, 155, 105, 155, 395,$white); Imagesetpixel ($img, 120, 250,$white); Imagearc ($img, 120, 250, 4, 4, 0, 360,$white); Imagearc ($img, 155, 250, 50, 125, 270, 450,$white);//Right GoalImageline ($img, 735, 175, 775, 175,$white); Imageline ($img, 735, 325, 775, 325,$white); Imageline ($img, 735, 175, 735, 325,$white); Imageline ($img, 775, 105, 650, 105,$white); Imageline ($img, 775, 395, 650, 395,$white); Imageline ($img, 650, 105, 650, 395,$white); Imagesetpixel ($img, 680, 250,$white); Imagearc ($img, 680, 250, 4, 4, 0, 360,$white); Imagearc ($img, 650, 250, 50, 125, 90, 270,$white);//small rectangles on both sidesImageline ($img, 25, 225, 20, 225,$white); Imageline ($img, 25, 275, 20, 275,$white); Imageline ($img, 20, 225, 20, 275,$white); Imageline ($img, 775, 225, 780, 225,$white); Imageline ($img, 775, 275, 780, 275,$white); Imageline ($img, 780, 225, 780, 275,$white);//four x CornersImagearc ($img, 25, 25, 23, 23, 0, 90,$white); Imagearc ($img, 775, 25, 23, 23, 90, 180,$white); Imagearc ($img, 25, 475, 23, 23, 270, 360,$white); Imagearc ($img, 775, 475, 23, 23, 180, 270,$white);//output an image to a browserHeader("Content-type:image/png"); Imagepng ($img);//Freeing MemoryImagedestroy ($img);

PHP Code Draw football field

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.