TAILIEUCHUNG - gdi programming with c sharp phần 10

Trong các chương trước của cuốn sách này, bạn đã học làm thế nào để vẽ đồ họa hình dạng, đường cong, và hình ảnh. Trong tất cả các trường hợp này, các đối tượng đồ họa là chịu trách nhiệm về bản vẽ. Khi chúng tôi đang vẽ đối tượng đồ họa từ bên trong một trình đơn hoặc xử lý sự kiện click nút, | This document was created by an unregistered ChmMagic please go to http to register it. Thanks Team LiB 4 PREVIOUS NEXT This document was created by an unregistered ChmMagic please go to http to register it. Thanks Understanding the Rendering Process In previous chapters of this book you learned how to draw graphics shapes curves and images. In all of these cases the Graphics object is responsible for the drawing. When we re drawing graphics objects from within a menu or button click event handler a call to theInvalidate method becomes imperative. If we don t call this method the form will not paint itself but if we write the same code on a form s OnPaint or paint event handler there is no need to invalidate the form. In this section we will find out why that s so. Understanding the Paint Event Paint event functionality is defined in the class which is the base class for Windows Forms controls such as Label ListBox DataGrid and TreeView. A paint event is fired when a control is redrawn. Th Form class itself is inherited from theControl class. Figure shows the Form class hierarchy. Figure . The Form class hierarchy The PaintEventArgs class provides data for the paint event. It provides two read-only propertiesClipRectangle and indicates the rectangle in which to paint and the Graphics property indicates theGraphics object associated with the paint event of a particular control including the form itself . Always be careful when you re dealing with the paint event because it is unpredictable and called automatically. The Control class also provides OnPaint methods which can be overridden in the derived classes to fire the paint event. The signature of the OnPaint method is defined as follows protected virtual void OnPaint PaintEventArgs e This document was created by an unregistered ChmMagic please go to http to register it. Thanks As this .

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.