TAILIEUCHUNG - Lập trình ứng dụng cho iPhone part 19

Graphics: Quartz, Core Animation, and OpenGL Như chúng ta đã thấy ở chương cuối cùng, tạo ra và hiển thị hình ảnh thường là không đủ. Trong trò chơi và các chương trình phức tạp khác, bạn cũng sẽ muốn vận dụng những hình ảnh trong nhiều cách khác nhau khi chạy. Các hệ điều hành iPhone cung cấp hai cách chính để làm điều này. Đầu tiên là thông qua 2D Quartz, một thư viện bản vẽ hai chiều, cho phép đối với bản vẽ dòng phức tạp, nhiều như Canvas đã làm trên web | GGraphics Quartz Core Animation and OpenGL This chapter covers Using Quartz 2D for drawing Understanding context paths and state Using Core Animation Learning about OpenGL ES As we saw in the last chapter creating and displaying images often isn t enough. In games and other more complex programs you ll also want to manipulate those images in various ways at runtime. The iPhone OS offers two major ways to do this. The first is through Quartz 2D a two-dimensional drawing library that allows for complex line drawings much as Canvas did on the web. It s also the heart of the Core Graphics frameworks. We already touched upon Quartz in the previous chapter when we drew images straight to the CALayer of a UlView it ll be the focus of the majority of this chapter. Quartz also supports Core Animation functions which we ll address somewhat more briefly. 366 The Quartz context 367 The second major way to manipulate images is through the OpenGL ES API. This cross-platform API originally developed by Silicon Graphics could be the topic of its own book so we ll just show you how to get started with it. But most of this chapter is going to be about Quartz a topic that we re going to dive into immediately. An introduction to Quartz 2D Quartz 2D is a two-dimensional drawing library that s tightly integrated into the iPhone OS. It works well with all the relevant iPhone frameworks including Core Animation OpenGL ES and the UIKit. Fundamentally Quartz s drawings depend upon three core ideas context paths and state each of which will be the topic of a future section. Context is a description of where the graphics are being written to as defined by a CGContextRef. You ll usually be writing to a UlView or to a bitmap. - Layers are a little less important for this overview but they re where Quartz drawing occurs. They can be stacked one on top of another creating a complex result. When working with the iPhone you ll often only have a single layer associated with each of your UIKit .

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.