These days it is all about enhancing the graphics, appearance and experience, the user-interface ‘look’, if you will. Lines, circles and shapes, boxes and more are needed. This is where the graphics class comes in. Creating things from scratch or modifying existing ones, both are possible. Add dynamically, create new, edit, resize, change compression ratios, crop, zoom in on pictures, add logos or copyright symbols by using the graphics classes, tools, code, commands and options. But it is also about more than the ability to draw mere graphics. Members, structures, controls, size, location, color, lines, shapes, fill, charts, images, pictures, creating, saving, displaying, pictures, icons, text to graphics, add-ons, add-ins, font-objects, formatting, alignment, legends and more, are all made possible through the know-how and utility of the graphics class.
These are easily accessed and located in the system drawing namespace. It contains, provides and enables all the tools, processes, commands and methods for drawing lines, shapes and text. Graphic elements show relationships, hierarchy, and emphasis visually. They include backgrounds, banners, glass, aggregators, separators, shadows, and handles.
The .NET Graphics Class encapsulates a GDI+ drawing surface, that cannot be inherited.
Access through System.Object, System.MarshalByRefObject, System.Drawing.Graphics
Its basic functionality is to provide methods for drawing objects to the display device.
Use and find it through the System.Drawing (in System.Drawing.dll) assembly.
More advanced functionality is provided in the System.Drawing.Drawing2D, System.Drawing.Imaging, and System.Drawing.Text namespaces. The Pen class is used to draw lines and curves, while classes derrived from the abstract class Brush are used to fill the interiors of shapes.
Key Exam Points
- Use of graphics classes, code, tools and utilities, for/in VB, C#, C++, .NET, user-interfaces, look/appearance, using Icons, Texture, bitmaps, font, images, graphs, lines, drawing forms and/or control pen or brush, all examples of the graphics class use and functionalities. Typically initialized through call control CreateGraphics method or object.
- Review the chapters, content and references pertaining to Fundamentals, Graphics.
- For the exam, practically work your way through each of these Graphic elements, classes and applications, members, enumerations and more. Find hands-on scenarios, cases, exercises and illustrative, real-life examples for graphics classes, to help you to gain a better understanding in this important exam topic
- Take the practice test, questions on theory and application exercises, sample questions (with answers and solutions)
Brush class, Bitmap class, Pen class, Interface.
This article is based on the 2nd edition of the Microsoft .Net Framework Application Training Kit with the purpose to help 70-536 Exam takers to succeed. I constantly look for ways to improve the content. Please leave a comment about this article or drop me a message if you would like to see changes for this site.