NET User Interfaces in Csharp Windows Forms and Custom Controls [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

NET User Interfaces in Csharp Windows Forms and Custom Controls [Electronic resources] - نسخه متنی

Matthew MacDonald

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



























Chapter 12: GDI+ Basics



Overview


.NET provides a new framework of classes for two-dimensional drawing and rendering. Taken together, these classes, found in the five System.Drawing namespaces (and contained in the System.Drawing.dll assembly), represent GDI+.

Technically, GDI+ still relies on the same low-level Windows APIs you may have used in Windows programming of the past. The APIs were often referred to as GDI (Graphics Device Interface). The central idea behind these GDI functions was that the programmer could write text and images to different devices (printers, monitors, and video cards), without needing to understand the underlying hardware. In turn, Windows ensured wide client compatibility, and made use of any optimizations that the hardware might provide. Unfortunately, the GDI functions required a lot of coding wizardry.

The GDI+ types in .NET are object-oriented wrappers over the low-level GDI functions and, strictly speaking, they don't add any new capabilities. However, the .NET types provide a higher level of abstraction, with convenient support for geometric transformations, antialiasing, and palette blending. Many of these techniques required a painful amount of tiresome coding (and lucky insights) to pull off in the past.

You've already seen GDI+ at work throughout this book. In fact, a number of the more advanced examples would have been impossible without it. A few examples include:



In Chapter 3, you saw many of the basic GDI+ ingredients in the System.Drawing namespace, including objects representing fonts, colors, position (points), and size (rectangles).



In Chapter 4, you saw an owner-drawn menu that created menu entries using text and a thumbnail icon.



In Chapter 5, you saw irregularly shaped forms that construct and outline their borders with a graphics path.



In Chapter 6, you saw how ImageList images could be drawn on a form's surface.



In Chapter 9, you saw a custom DataGrid column that draws text content and an icon.



This chapter explains the underlying GDI+ framework that makes all this possible.


/ 142