The Graphics Class

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); }

The Graphics Class

At the root of GDI+ is the System.Drawing.Graphics class. This class encompasses methods for drawing text, icons, images, rectangles, ellipses, curves, and everything in between. The Graphics class is the heart and sole of GDI+, and you'd do well to familiarize yourself with the services it offers, as well as its limitations.

Although the Graphics class provides the means to render basic shapes and images to a window, it requires a supporting cast. This supporting cast comprises brushes, pens, fonts, and even images. All of these objects work together to produce the final result displayed on the screen or printer.

An important note about GDI+ is that the programming model is a static model, whereas previous versions of GDI were stateful models. This means that for GDI+ to work, it requires resources such as brushes and pens to be managed by the developer rather than the GDI API. For seasoned Win32 GDI developers, this new model requires some getting used to; however, the new GDI+ offers increased performance and ease of use.



    .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