Visual C++ and MFC Fundamentals programming phần 4

Để sử dụng các đối tượng MFC trong ứng dụng của bạn như trái ngược với các đối tượng không-MFC, bạn phải cho phép trình biên dịch biết. Điều này được thực hiện bằng cách xác định rằng bạn muốn để sử dụng MFC DLL chia sẻ, như chúng ta đã thực hiện cho đến nay. Ngoài ra, nếu bạn muốn cửa sổ của bạn để có một sự xuất hiện 3-D, gọi phương pháp Enable3dControls (). Nếu bạn không muốn sự xuất hiện 3-D, gọi Enable3dControlsStatic (). Cách tốt nhất để đối phó với việc này là yêu. | Visual C and MFC Fundamentals Chapter 8 GDI Orientation and Transformations To produce a shadow effect you can add another copy of the same text on a slightly different location and call the CDC SetBkMode method. Here is an example void CExoView OnDraw CDC pDC CExoDoc pDoc GetDocument ASSERT_vAlID pDoc CFont font 920 Garamond CFont pFont pDC- SelectObject font pDC- SetBkMode TRANSPARENT pDC- SetTextColor RGB 110 185 250 pDC- TextOut 26 24 Christine 9 pDC- SetTextColor RGB 0 0 255 pDC- TextOut 20 18 Christine 9 pDC- SelectObject pFont One of the most complete means of creating a font is by using the CFont CreateFont method. Its syntax is BOOL CreateFont int nHeight int nWidth int nEscapement int nOrientation int nWeight byte bItalic byte bUnderline byte cStrikeOut FunctionX Inc. 211 Chapter 8 GDI Orientation and Transformations Visual C and MFC Fundamentals BYTE nCharSet BYTE nOutPrecision BYTE nClipPrecision BYTE nQuality BYTE nPitchAndFamily LPCTSTR lpszFacenaime The nHeight argument is the height applied to the text. The nWidth value is the desired width that will be applied on the text. The nEscapement is the angle used to orient the text. The angle is calculated as a multiple of and oriented counterclockwise. The nOrientation is the angular orientation of the text with regards to the horizontal axis. The nWeight is used to attempt to control the font weight of the text because it is affected by the characteristics of the font as set by the designer. It holds values that displays text from thin heavy bold. The possible values are Constant Value Constant Value FW DONTCARE 0 FW THIN 100 FW EXTRALIGHT 200 FW ULTRALIGHT 200 FW LIGHT 300 FW NORMAL 400 FW REGULAR 400 FW MEDIUM 500 FW SEMIBOLD 600 FW DEMIBOLD 600 FW BOLD 700 FW EXTRABOLD 800 FW ULTRABOLD 800 FW BLACK 900 FW HEAVY 900 The bItalic specifies whether the font will be italicized TRUE or not FALSE . The bUnderline is used to underline TRUE or not .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.