TAILIEUCHUNG - Illustrated WPF phần 10

Không giống như các lớp GeometryGroup, mà là chỉ là một bộ sưu tập các đối tượng hình học, lớp CombinedGeometry kết hợp các bộ phận chính xác đối tượng hình học hai vào một đối tượng duy nhất là không giống như một trong hai đối tượng ban đầu. Hình 18-38 cho thấy kết quả của việc kết hợp hai elip chồng chéo, sử dụng bốn hoạt động kết hợp. | CHAPTER 18 GRAPHICS IN WPF Unlike the GeometryGroup class which is a just a collection of Geometry objects the CombinedGeometry class combines parts of exactly two Geometry objects into a single object that is unlike either of the two original objects. Figure 18-38 shows the results of combining two overlapping ellipses using the four available combining operations. Figure 18-38. The CombinedGeometry class allows you to combine two Geometry objects yielding a new path different from either ofthe two initial Geometries. Figure 18-39 shows the important properties of the CombinedGeometry class. Notice that it takes exactly two Geometry objects and a mode for combining them. I CombinedGeometry I Geometry I Geometry I GeometryCombineMode I Figure 18-39. The CombinedGeometry class The following is the markup of the top-right screen in Figure 18-38 Path Stroke Black StrokeThickness 2 Fill LightGray CombinedGeometry GeometryCombineMode Xor EllipseGeometry Center 60 50 RadiusX 40 RadiusY 30 EllipseGeometry Center 100 50 RadiusX 40 RadiusY 30 CombinedGeometry Path 440 CHAPTER 18 GRAPHICS IN WPF Path Markup Syntax From the previous examples you can see that the markup for the PathFigures in a PathGeometry object can be quite extensive even to describe simple paths. To remedy this WPF provides the path markup syntax which allows you to significantly abbreviate the markup. To use the path markup syntax you assign a string to the Figures property of the PathGeometry. The string contains shorthand for describing the path. The following are some important things to know about the path markup syntax The syntax consists of single-letter commands followed by sets of numeric parameters. The meanings of the numeric parameters depend on the command. There are three types of commands. - The move command This command sets the start point of the figure. This .

TỪ KHÓA LIÊN QUAN
Đã 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.