TAILIEUCHUNG - Apress pro Silverlight 3 in C# phần 7

SilverLight là một công nghệ đa nền tảng, cho phép xây dựng các ứng dụng tương tác trên Web không phụ thuộc trình duyệt và tương tác với server. Dùng SilverLight, bạn có thể xây dựng các loại ứng dụng sau: - Các ứng dụng nặng cho phép xem phim, nghe nhạc trên Internet - Các ứng dụng nhỏ, kiểu như game hoặc các thành phần tương tác khác - Các thành phần trực quan trên Web, hiển thị dữ liệu | CHAPTER 10 ANIMATION Thus if you have animations that perform scaling rotation or fading on an element you ll get a benefit from hardware acceleration. However if you have animations that do anything else to change the way an element looks for example skewing an element changing its color rotating it in 3D space with a perspective transform applying a pixel shader and so on you should definitely not use bitmap caching. In this sort of situation Silverlight will be forced to keep passing an updated copy of the bitmap back to the video card updating its cache several times a second. This process will actually decrease performance. To switch on bitmap caching you set the CacheMode property of the corresponding element to BitmapCache. Every element provides this property which means you have a finegrained ability to choose exactly which elements use this feature. Note If you cache an element that contains other elements like a layout container all the elements will be cached in a single bitmap. Thus you need to be extremely careful about adding caching to something like a Canvas only do it if all the children are limited to the allowed transformations in the list above. To get a better understanding it helps to play with a simple example. Figure 10-15 shows a project that s included with the downloadable samples for this chapter. Here two animations are at work. The first rotates an Image element that contains the picture of a phone booth. The second one changes the size of a button using a ScaleTransform endlessly expanding and shrinking it. Both animations are clear candidates for bitmap caching. Figure 10-15. A test page with two animated elements 381 CHAPTER 10 ANIMATION Here s the markup that switches on bitmap caching for both Canvas Image x Name img Source Stretch None CacheMode BitmapCache RotateTransform x Name rotateTransform RotateTransform Image Button x Name cmd Content I GROW and SHRINK. .

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.