This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Tha.nks [ Team LiB ] • Table of Contents Graphics Programming with GDI+ By Mahesh Chand Publisher: Addison Wesley Pub Date: October 17, 2003 ISBN: 0-321-16077-0 Pages: 784 "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 This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks . 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. [ Team LiB ] This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks. [ Team LiB ] • Table of Contents Graphics Programming with GDI+ By Mahesh Chand Publisher: Addison Wesley Pub Date: October 17, 2003 ISBN: 0-321-16077-0 Pages: 784 Copyright Praise for Graphics Programming with GDI+ Microsoft .NET Development Series Figures Tables Acknowledgments Introduction Who Is This Book For? Prerequisites What's in This Book That I Won't See in Other Books? Chapter Organization Example Source Code Exception and Error Handling in the Samples SUMMARY Chapter 1. GDI+: The Next-Generation Graphics Interface Section 1.1. Understanding GDI+ Section 1.2. Exploring GDI+ Functionality Section 1.3. GDI+ from a GDI Perspective Section 1.4. GDI+ Namespaces and Classes in .NET Summary Chapter 2. Your First GDI+ Application This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks. Section 2.1. Drawing Surfaces Section 2.2. The Coordinate System Section 2.3. Tutorial: Your First GDI+ Application Section 2.4. Some Basic GDI+ Objects SUMMARY Chapter 3. The Graphics Class Section 3.1. Graphics Class Properties Section 3.2. Graphics Class Methods Section 3.3. The GDI+Painter Application Section 3.4. Drawing a Pie Chart SUMMARY Chapter 4. Working with Brushes and Pens Section 4.1. Understanding and Using Brushes Section 4.2. Using Pens in GDI+ Section 4.3. Transformation with Pens Section 4.4. Transformation with Brushes Section 4.5. System Pens and System Brushes Section 4.6. A Real-World Example: Adding Colors, Pens, and Brushes to the GDI+Painter Application SUMMARY Chapter 5. Colors, Fonts, and Text Section 5.1. Accessing the Graphics Object Section 5.2. Working with Colors Section 5.3. Working with Fonts Section 5.4. Working with Text and Strings Section 5.5. Rendering Text with Quality and Performance Section 5.6. Advanced Typography Section 5.7. A Simple Text Editor Section 5.8. Transforming Text SUMMARY Chapter 6. Rectangles and Regions Section 6.1. The Rectangle Structure Section 6.2. The Region Class Section 6.3. Regions and Clipping Section 6.4. Clipping Regions Example Section 6.5. Regions, Nonrectangular Forms, and Controls SUMMARY Chapter 7. Working with Images Section 7.1. Raster and Vector Images Section 7.2. Working with Images Section 7.3. Manipulating Images Section 7.4. Playing Animations in GDI+ Section 7.5. Working with Bitmaps Section 7.6. Working with Icons Section 7.7. Skewing Images Section 7.8. Drawing Transparent Graphics Objects This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks. Section 7.9. Viewing Multiple Images Section 7.10. Using a Picture Box to View Images Section 7.11. Saving Images with Different Sizes SUMMARY Chapter 8. Advanced Imaging Section 8.1. Rendering Partial Bitmaps Section 8.2. Working with Metafiles Section 8.3. Color Mapping Using Color Objects Section 8.4. Image Attributes and the ImageAttributes Class Section 8.5. Encoder Parameters and Image Formats SUMMARY Chapter 9. Advanced 2D Graphics Section 9.1. Line Caps and Line Styles Section 9.2. Understanding and Using Graphics Paths Section 9.3. Graphics Containers Section 9.4. Reading Metadata of Images Section 9.5. Blending Explained Section 9.6. Alpha Blending Section 9.7. Miscellaneous Advanced 2D Topics SUMMARY Chapter 10. Transformation Section 10.1. Coordinate Systems Section 10.2. Transformation Types Section 10.3. The Matrix Class and Transformation Section 10.4. The Graphics Class and Transformation Section 10.5. Global, Local, and Composite Transformations Section 10.6. Image Transformation Section 10.7. Color Transformation and the Color Matrix Section 10.8. Matrix Operations in Image Processing Section 10.9. Text Transformation Section 10.10. The Significance of Transformation Order SUMMARY Chapter 11. Printing Section 11.1. A Brief History of Printing with Microsoft Windows Section 11.2. Overview of the Printing Process Section 11.3. Your First Printing Application Section 11.4. Printer Settings Section 11.5. The PrintDocument and Print Events Section 11.6. Printing Text Section 11.7. Printing Graphics Section 11.8. Print Dialogs Section 11.9. Customizing Page Settings Section 11.10. Printing Multiple Pages Section 11.11. Marginal Printing: A Caution Section 11.12. Getting into the Details: Custom Controlling and the Print Controller This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks . SUMMARY Chapter 12. Developing GDI+ Web Applications Section 12.1. Creating Your First ASP.NET Web Application Section 12.2. Your First Graphics Web Application Section 12.3. Drawing Simple Graphics Section 12.4. Drawing Images on the Web Section 12.5. Drawing a Line Chart Section 12.6. Drawing a Pie Chart SUMMARY Chapter 13. GDI+ Best Practices and Performance Techniques Section 13.1. Understanding the Rendering Process Section 13.2. Double Buffering and Flicker-Free Drawing Section 13.3. Understanding the SetStyle Method Section 13.4. The Quality and Performance of Drawing SUMMARY Chapter 14. GDI Interoperability Section 14.1. Using GDI in the Managed Environment Section 14.2. Cautions for Using GDI in Managed Code SUMMARY Chapter 15. Miscellaneous GDI+ Examples Section 15.1. Designing Interactive GUI Applications Section 15.2. Drawing Shaped Forms and Windows Controls Section 15.3. Adding Copyright Information to a Drawn Image Section 15.4. Reading and Writing Images to and from a Stream or Database Section 15.5. Creating Owner-Drawn List Controls SUMMARY Appendix A. Exception Handling in .NET Section A.1. Why Exception Handling? Section A.2. Understanding the try...catch Block Section A.3. Understanding Exception Classes SUMMARY [ Team LiB ] This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to regis.ter it. Thanks [ Team LiB ] Copyright Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and Addison-Wesley was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The .NET logo is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries and is used under license from Microsoft. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers discounts on this book when ordered in quantity for bulk purchases and special sales. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside of the U.S., please contact: International Sales (317) 581-3793 [email protected] Visit Addison-Wesley on the Web: www.awprofessional.com Library of Congress Cataloging-in-Publication Data Chand, Mahesh Graphics programming with GDI+ / Mahesh Chand. p. cm. ISBN 0-321-16077-0 (alk. paper) 1. Computer graphics. 2. User interfaces (Computer systems) I. Title T385.C4515 2003 006.6—dc22 2003057705 Copyright © 2004 by Pearson Education, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher. Printed in the United States of America. Published simultaneously in Canada. For information on obtaining permission for use of material from this work, please submit a written request to: This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks . Pearson Education, Inc. Rights and Contracts Department 75 Arlington Street, Suite 300 Boston, MA 02116 Fax: (617) 848-7047 Text printed on recycled paper 1 2 3 4 5 6 7 8 9 10—CRS—0706050403 First printing, October 2003 Dedication To Mel and Neel [ Team LiB ] This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks . [ Team LiB ] Praise for Graphics Programming with GDI+ "This is the most comprehensive book about graphics programming using GDI+ so far. A lot of useful sample code inside this book reveals that Mr. Chand apparently has done a fair amount of research on GDI+. 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+ 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 FX "Mahesh 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 [ Team LiB ]