TAILIEUCHUNG - PHP Game Programming 2004 phần 6

Wow, bạn đang nhanh chóng trở thành một bậc thầy tạo ra trên-the-fly hình ảnh với GD. Sau khi bạn tìm hiểu làm thế nào để tạo ra vòng cung và hình elip, bạn sẽ di chuyển để đưa văn bản động trong đồ họa của bạn, và cuối cùng bạn sẽ có một chiều sâu xem làm thế nào để hiển thị và lưu hình ảnh on-the-fly. | 174 Chapter 8 GD Graphics Overview Figure Drawing a polygon with the ImagePolygon function. The ImageFilledPolygon function takes the same parameters as the ImagePolygon function but instead of drawing an outline of the polygon it draws a filled-in version of the polygon. Here is a modified function for the ImageFilledPolygon function php function MyFilledPolygon image points color Calculate the number of vertices in the polygon vertices sizeof points 2 Draw the polygon to the canvas ImageFilledPolygon image points vertices color From Polygons to Arcs and Ellipses Wow you are quickly becoming a master at creating on-the-fy images with GD. After you learn how to create arcs and ellipses you will move on to putting dynamic text in your graphics and finally you will take a more in-depth look at how to display and save your on-the-fy images. GD provides you with a function called ImageArc to create well arcs. This function takes a whopping eight arguments. The first is the resource to the image. The next two arguments are the center x point for the arc and the center y point for the arc. The fourth and fifth arguments are the desired width of the arc and then the desired height of the arc. The sixth argument is the starting degree for the arc. The seventh argument is the ending degree for the arc. The eighth and final argument is the color that you would like the arc to appear in. Drawing Basic Shapes on Your Empty Canvas 175 Note The ImageArc function draws in a clockwise direction. The ImageArc function puts 0 degrees at three o clock 90 degrees at six o clock 180 degrees at nine o clock and 270 degrees at twelve o clock. Although documentation on says that the ImageArc function draws counter-clockwise it actually draws clockwise. Take a look at how you would use the ImageArc function and the results. php image ImageCreate 320 200 white ImageColorAllocate image 255 255 255 black ImageColorAllocate image 0 0 0 ImageFill image 0 0 white ImageArc image .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.