
.NET DEVELOPER
Working with graphics
Jim Mischel 04.20.2004
Rating: -4.00- (out of 5)




|
The first step in working with graphics in .NET is understanding the contents of each graphics related namespace. In this tip from Jim Mischel's .NET Resource Center from InformIT, he takes a look at the contents of the graphics namespaces.
The .NET Framework includes a rich set of managed classes that serve as wrappers around GDI+, the Windows XP graphics API. GDI+ improves on the original Windows Graphics Device Interface by providing new features and optimizations. The .NET Framework managed classes create an object-oriented and easy to use interface to the GDI+ graphics facilities, and completely insulate the programmer from the need to manage display contexts, handles, and other Windows graphics arcana. The programming model isn't completely different from GDI, though. If you've done Windows GDI programming you'll be right at home with the managed classes, and happy to be freed from worrying about the more mundane aspects of managing device contexts, handles, and graphics objects.
The .NET graphics API is fully contained in the System.Graphics namespace. System.Graphics contains classes that perform basic drawing functions, and namespaces that provide more specialized functionality. The table below briefly describes the contents of each of the namespaces.
Contents of System.Drawing namespaces
| Namespace | Contents |
| System.Drawing | Contains classes that encapsulate basic graphics objects including pens, brushes, images, points, rectangles, colors, and fonts. |
| System.Drawing.Design | Provides user interfaces for selecting or defining bitmaps, fonts, images, and other graphics objects. |
| System.Drawing.Drawing2D | Includes classes that provide advanced two-dimensional and vector graphics functionality, including gradient brushes, geometric transformations, and graphics paths. |
| System.Drawing.Imaging | Classes in this namespace provide advanced imaging functionality, including metafiles and classes that allow the GDI to be extended to work with any image file format. |
| System.Drawing.Printing | Provides print-related services, including print preview. |
| System.Drawing.Text | Provides enhanced text-handling capabilities, specifically in the area of fonts. |
You'll find that most of your graphics work will be with classes defined in the System.Drawing and System.Drawing.Drawing2D namespaces.
Learn how to draw lines and curves in .NET at InformIT.
 |

|
Rate this Tip
|
To rate tips, you must be a member of SearchSOA.com. Register now
to start rating these tips. Log in if you are already a member.
|


');
// -->
DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.
|
 |
|
|
 |
|
 |