Chapter 4 - GDI

function OpenWin(url, w, h) { if(!w) w = 400; if(!h) h = 300; window.open(url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true); }

Chapter 4 - GDI+

IN THIS CHAPTER

  • The Graphics Class

  • Brushes

  • Pens

  • Fonts

  • Working with Images

  • The ControlPaint Class

Before this chapter dives into the details of control development, a brief tour of GDI+ is in order. GDI stands for Graphics Device Interface, an abstraction for drawing to a graphics-capable device such as the screen or printer. GDI+ is the next stage of evolution in the development of the Win32 GDI API.

One of the major tasks associated with Windows development is the task of rendering or painting on the screen or printer. Humans are visual creatures, and as such the capability to provide information and feedback through visual means is important. Consider data within a spreadsheet. Although the actual figures and formulas detail the exact data and necessary information, providing different styles of graphs of the data often helps us visualize the information. This presentation of data is just as important when developing various user interface elements such as custom buttons, menus, and toolbars.

GDI+ represents the latest Graphics Device Interface API provided by the .NET framework. GDI+ is a major improvement over the somewhat archaic Win32 GDI calls of yesteryear, and it provides a simple object model for a graphics interface.

One of the major portions of control development is the user interface it presents to the user. In fact, a lot of time and effort will be spent on the painting code necessary to create just the right look and feel you're after for the control. The goal of this chapter is to explore some of the objects associated with GDI programming. Issues such as different styles of brushes, pens, fonts, and image formats are covered because they are likely to be a common theme when developing custom controls and Windows applications in general.



    .NET Windows Forms Custom Controls
    User Interfaces in VB .NET: Windows Forms and Custom Controls
    ISBN: 1590590449
    EAN: 2147483647
    Year: 2002
    Pages: 74

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net