
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Graphics Programming With Gdi+ Paperback – January 1, 2003
- Print length704 pages
- LanguageEnglish
- PublisherAddison-Wesley Professional
- Publication dateJanuary 1, 2003
- Dimensions7 x 1.5 x 9.25 inches
- ISBN-100321160770
- ISBN-13978-0321160775
Book recommendations, author interviews, editors' picks, and more. Read it now
Frequently purchased items with fast delivery
Editorial Reviews
From the Back Cover
Graphics Programming with GDI+ explores and exploits a wonderful range of GDI+ programming concepts, techniques, and applications for programmers of beginner to intermediate abilities. Being a prolific contributor to the Internet community of developers, Mahesh Chand is offering what seems to be a natural extension of what he does best sharing his programming skills with other talented programmers. Each chapter compels to the next.
Jason Hattingh, Director, Greystone Digital FXMahesh does a very good job getting .NET developers up to speed using the GDI+ features supported in the .NET Framework. There is good coverage of graphics fundamentals that helps the reader better understand the concepts of graphics programming with GDI+, and there are some excellent sample applications that demonstrate the graphics topics covered to reinforce the concepts presented.
Charles G. Parker, President, Parallel Consulting, Inc.Graphics Programming with GDI+ is a comprehensive reference for anyone who wants to leverage this technology. It presents a clear discussion of the topics in such a manner that is comprehensible to the beginner, but sufficiently in-depth to challenge seasoned programmers.
Deborah J. Bechtold, MCSD, MCDBA"This is the most comprehensive book about graphics programming using GDI+ so far. This book will be a very useful handbook for everyone who does graphics programming for Windows."
Min Liu, Software Design Engineer of GDI+, Microsoft Corporation
Graphics Programming with GDI+ is the .NET developer's guide to writing graphics applications for Windows and the Web. Through the use of detailed examples it provides experienced programmers with a deep understanding of the entire GDI+ API defined in the .NET Framework class library.
The book begins with an introduction to GDI+ and the basics of graphics programming in Windows. The core of the book is a hands-on guide to practical topics, including how to use Windows Forms and optimize GDI+ performance. Chapters demonstrate how to develop real-world tools such as GDI+Painter, GDI+Editor, ImageViewer, and ImageAnimator. The author provides extensive reusable sample code in C# throughout, and complete downloadable source code in C# and Visual Basic .NET is available online, as are color versions of screen shots from the book.
Key topics include:
- How GDI+ compares to GDI
- How GDI+ is defined and used in the .NET Framework
- How to draw, paint, and fill graphics objects
- Viewing and manipulating images
- Transforming graphics objects, images, and colors
- Printing in .NET
- How to develop GDI+ Web applications
- How to optimize drawing quality and performance
- Interactive color blending and transparent colors
- GDI interoperability
- Answers to frequently asked GDI+ questions
Graphics Programming in GDI+ is the most in-depth treatment available on writing effective graphics applications for the .NET Framework.
About the Author
Mahesh Chand is a .NET consultant and the founder and administrator of two popular community Web sites, www.c-sharpcorner.com and www.mindcracker.com. He has been working with .NET since the pre-beta releases. Mahesh is the author of A Programmer¿s Guide to ADO.NET in C# (APress, 2002) and coauthor of Applied ADO.NET (APress, 2003).
0321160770AB09252003
Excerpt. © Reprinted by permission. All rights reserved.
By introducing the .NET Framework to the programming world, Microsoft has changed the perspective and vision of programming and programmers. Unlike previous programming environments, the .NET Framework is designed with the future of software development in mind. Besides introducing the new C# language and significant additions to Visual Basic .NET and other languages, the .NET Framework provides many new tools and utilities that make a programmer's life easier.
Languages, tools, and utilities aside, the .NET Framework library is the real power of the .NET Framework. It's an object-oriented class library that defines an interface to interact with various programming technologies. Any programming language that is designed to work with the .NET Framework can access the library, which makes a programmer's life easier because the methods and properties defined in the library are the same, regardless of the language.
Each class defined in the .NET Framework library belongs to a particular namespace--a logical unit that is used to separate a particular programming interface from others. For example, the System.Windows.Forms namespace defines classes that are used for WindowsForms development. System.Data and its subnamespaces define classes that are used for database development (ADO.NET).
GDI+ is the next-generation graphics device interface, defined in System.Drawing and its subnamespaces. This book focuses on how to write graphical Windows and Web applications using GDI+ and C# for the Microsoft .NET Framework.
Who Is This Book For?
This book is designed for intermediate developers who want to write graphics applications for the .NET Framework using GDI+ and C#. Here are the topics we will cover:
- What GDI+ is all about, and how it differs from GDI
- How GDI+ works, and where it is defined in the .NET Framework library
- How to draw text, lines, curves, rectangles, ellipses, and other graphics shapes in GDI+
- How to fill rectangles, ellipses, and other closed curves with different colors, styles, and textures
- Painting and drawing in .NET
- Viewing and manipulating images
- How Windows Forms and Web Forms are related to drawing
- How to write Web-based graphics applications
- Printing in .NET
- Transforming graphics objects, colors, and images
- Interactive color blending and transparent colors
- Using GDI in .NET applications
- Precautions to take when writing GDI+ applications
- Optimizing the performance of GDI+ applications
Prerequisites
There are some things you should know before beginning this book:
- Language: This book is written in C#, but developers who want to use GDI+ with other .NET Framework languages--including Visual Basic .NET--can also use this book. Because C# and VB.NET share the same .NET Framework library, there isn't much difference aside from the language syntaxes. Knowledge of C# or VB.NET is not a requirement, however. If you are a C++ developer, you should have no difficulty using this book.
- Framework: I used Visual Studio .NET to develop and test the samples in this book. Knowledge of Visual Studio .NET and basics of the .NET Framework is a requirement.
- Basics of graphics programming: A basic understanding of graphics programming is a plus but is not mandatory.
- GDI programming experience: Experience with GDI programming is a plus but is not mandatory.
What's in This Book That I Won't See in Other Books?
- This book is written by an experienced author who has been watching every .NET move closely since the birth of .NET.
- The author works very closely with the .NET community and has extensive experience developing real-world .NET applications.
- Besides covering GDI+-related namespaces and classes, this book takes a practical approach, discussing all concepts.
- Almost every chapter of the book ends with a real-world application, including FirstWebApp, GDI+Painter, ImageViewer, and many more.
- One chapter (Chapter 13) is dedicated to GDI+ performance techniques, discussing what to do and what not to do, when we're writing graphics applications in .NET using GDI+.
Chapter Organization
Before we start, let's take a quick tour of this book. It has 15 chapters and one appendix. Here's a brief introduction:
Chapter 1: GDI+: The Next-Generation Graphics Interface
GDI+ is a new and improved version of GDI. This chapter introduces the GDI+ library, its advantages over previous versions, new features and additions to the library, and how it is related to the .NET Framework.
Chapter 2: Your First GDI+ Application
In the .NET Framework Library, GDI+ functionality is defined in the System.Drawing namespace and its subnamespaces. This chapter discusses the contents of these namespaces. After finishing this chapter, you will understand which functionality is defined where and when to which namespace.
Chapter 3: The Graphics Class
The Graphics class plays a major role in GDI+. Whenever you need to draw a graphics object, you must use the Graphics class. This chapter discusses Graphics class methods and properties, and how to use them. After completing this chapter, you'll have a pretty good idea how to draw and fill various graphics objects.
Chapter 4: Working with Brushes and Pens
Brushes and pens are used to fill and draw graphics objects. GDI+ provides many classes for working with brushes and pens. This chapter describes how to work with them.
Chapter 5: Colors, Fonts, and Text
This chapter discusses the color-, font-, and text-related classes provided by the .NET Framework class library in more detail.
Chapter 6: Rectangles and Regions
Rectangles and regions can be very useful--and very tricky. This chapter covers them in detail.
Chapter 7: Working with Images
The .NET Framework divides GDI+ functionality between two namespaces: System.Drawing and System.Drawing.Imaging. This chapter covers the basic imaging-related functionality defined in the System.Drawing namespace
Chapter 8: Advanced Imaging
This chapter discusses more imaging functionality, including the System.Drawing.Imaging namespace and how to work with metafiles in the .NET Framework. We will also see how to maintain the quality and rendering speed of images in GDI+.
Chapter 9: Advanced 2D Graphics
This chapter discusses advanced two-dimensional graphics programming using GDI+. Advanced 2D techniques and tools include blending, matrices, graphics paths, and gradient brushes.
Chapter 10: Transformation
This chapter examines GDI+ transformation. Transformation can be applied not only to graphics shapes, curves, and images, but also to image colors.
Chapter 11: Printing
Printing functionality in the .NET Framework library is defined in the System.Drawing.Printing namespace. This chapter explores this namespace and how to write printing applications.
Chapter 12: Developing GDI+ Web Applications
GDI+ can also be used in Web applications. This chapter discusses how to use GDI+ in Web applications with ASP.NET.
Chapter 13: GDI+ Best Practices and Performance Techniques
This chapter concentrates on GDI+ best practices and GDI+-related tips and tricks to improve the quality and performance of drawing.
Chapter 14: GDI Interoperability
This chapter demonstrates how GDI can be used with GDI+ in managed applications.
Chapter 15: Miscellaneous GDI+ Examples
In this chapter we have some fun with GDI+. Among the topics in this chapter are designing interactive GUI applications, creating shaped forms, and adding custom text in images.
Appendix A: Exception Handling in .NET
This appendix introduces exception and error handling in .NET.
Example Source Code
Complete source code for the examples in this book (in both C# and Visual Basic .NET) is available for download at www.awprofessional.com/titles/0321160770.
Exception and Error Handling in the Samples
The .NET Framework supports structured exception handling that's similar to C++ exception handling. The examples in this book do not include exception handling code. Adding exception handling code to every code snippet would have been confusing and redundant. Instead, we discuss exception and error handling concepts in Appendix A. It is highly recommended that you read Appendix A and apply exception and error handling techniques in your applications.
0321160770P10142003
Product details
- Publisher : Addison-Wesley Professional
- Publication date : January 1, 2003
- Edition : 1st
- Language : English
- Print length : 704 pages
- ISBN-10 : 0321160770
- ISBN-13 : 978-0321160775
- Item Weight : 2.45 pounds
- Dimensions : 7 x 1.5 x 9.25 inches
- Best Sellers Rank: #4,817,949 in Books (See Top 100 in Books)
- #699 in Microsoft .NET
- #1,013 in User Experience & Website Usability
- #2,641 in Graphics & Multimedia Programming
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read book recommendations and more.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews. Please reload the page.
- Reviewed in the United States on December 11, 2019Best VB net graphics book with a CD of VB examples
- Reviewed in the United States on March 16, 2004This book has a really promising title and table of content, but once you start going deeper you'll see just a repetition of information from .net documentation.
There are many tables listing some properties or enumerations with exact wording from .net docs. In some instances author tries to explain more below, but ends up rephrasing the same thing.
There are few good things about the book. Lots of code examples (too bad you have to download it and no CD with book). Some chapters include useful more detailed information, but it's hard to find it within the ".net docs copied" content.
- Reviewed in the United States on September 1, 2014i receive it in very good conditions
- Reviewed in the United States on July 3, 2006I had heard great things about this book, however I came accross bad reviews as well. People said it was a replication of the msdn documentation. The fact is that it is in some ways, but I think most books are. This book was to the point and explained the concepts of 2D Graphics in .NET. I used it to design a badging software and this book saved me the time to look up on msdn. However, if you are interested in 3D graphics/games or 2D games, do no use GDI+, use DirectX.
- Reviewed in the United States on January 30, 2008i bought this book back in August 2004 hoping to make something useful out of GDI+. four yrs later, i can tell you that u can get a better info from MSDN. the cost of this book is just for people who want to read stuff on paper format.
it would be a useful book if the author created a REAL life samples after he explained each topic.
- Reviewed in the United States on July 7, 2004I've to start with saying "great work" to the author who has compiled a great book with many real world code samples. I've been looking for a book on graphics programming which discusses the basics of drawing process in .NET and this is where I found full satisfaction.
Briefly, Mr. Chand starts the book with introduction of GDI+ for a beginner as well as from a GDI developer's perspective. Chapter 2 definitely is the smartest and cleanest chapter. Its a tutorial with explaining how the whole drawing and rendering process works with flow charts and images.
Later chapters just get better and better. Chapter 3 is all about the Graphics class, its members, and how to use the in applications.
Chapter 4, 5, & 6 are dedicated to brushes and pens, colors, font, text, rectangles and regions. Its unbelivable how author has discussed every little detail about these objects. How about 45 pages on just pens & brushes?
Chapter 7 and 8 are dedicated to Imaging and Advanced Imaging (over 100 pages). Again every little details are covered.
I personally found Chapter 9 the most useful. This chapter discusses advanced drawing and some of the topics are detailed discussions about containers, line caps and styles, graphics paths, metadata of images, blending - alpha blending and color blending and so on.
Chapter 10 is all about transformations. Transformation of font, text, images, paths, and even color. Wonderful.
Printing perhaps does not belong to this book but its again one of the great chapters in this book. Over 100 pages dedicated to printing and you will find every single object followed by sample code.
I havn't used next chapters - which are DEVELOPING WEB APPLICATIONS using GDI+, Best Practices, GDI Interop, and Exceptions but I am not these are some bonus to the reader.
OVERALL, a PERFECT BOOK you need to learn any thing defined in System.Drawing and other drawing namespaces.
All chapters are follwed by a real world practical example such as writing your own PaintBrush, TextEditor, Image Viewer, Printer Dialog and so on.
Try it and you will find yourself very satisfied. I sure did.
Cheers!
Monica
- Reviewed in the United States on October 19, 2009It seems that the author just wrapped the official documentation of GDI+ with some literary style. While the text is easier to read than the MS doc, you won't go far with it : a lot of remarks and most samples are just useless (imagine an "Hello World" written for every methods through the books).
The MS documentation has a very dry style, but mostly go to the point. With this book, you'll take the longer way ...
- Reviewed in the United States on May 2, 2005Let me start by saying this book does not attempt to be something it is not. It's not a generic book on Windows or ASP.NET programming. It deals specifically with one topic. Having said that, GDI+ is a broader topic than you might think and this book does a terrific job of breaking the information up into relevant subtopics.
The material is presented in an interesting, conversational tone that uses REAL WORLD EXAMPLES. You actually build several small GDI+ applications by the time you finish the book.
I'm an MCSD.NET and MCT, and I give presentations on GDI+ to user groups and recently at MSDN Code Camps. This is the book I give away to people in my presentations. If you've ever been stuck on GDI+ and found the MSDN documentation lacking, this is the book for you.
It's worth mentioning that all of the examples are in C# (the author is also a C# guru, so I wasn't surprised), but considering most of the code is method calls, there's nothing here that a competent VB.NET programmer couldn't convert on the fly. Don't let that be a reason to discourage you from buying this excellent book.
Mahesh Chand has done a terrific job, and should give his editor a raise. The book is very well laid out and organized. I refer to it often.
Top reviews from other countries
- valecaReviewed in Canada on June 25, 2017
4.0 out of 5 stars Four Stars
Introduction to GDI+ in C#