Jump to ratings and reviews
Rate this book

C# Graphics Programming

Rate this book
This Wrox Blox teaches you how to add graphics to C# 2008 applications, explaining fundamental graphics techniques such drawing shapes with different colors and line styles; filling areas with colors, gradients, and patterns; drawing text that is properly aligned, sized, and clipped exactly where you want it; manipulating images and saving results in bitmap, JPEG, and other types of files. Also covered are instructions for how to greatly increase your graphics capabilities using transformations. Transformations allow you to move, stretch, or rotate graphics. They also let you work in coordinate systems that make sense for your application. You will also learn how to use all of these techniques in printouts. The author describes the sequence of events that produce a printout and shows how to generate and preview printouts. The final sections describe two powerful new graphic tools that were introduced with .NET Framework 3.0: WPF graphics and FlowDocuments. WPF applications can use XAML graphic commands to declaratively draw and fill the same kinds of shapes that a program can draw by using graphics objects. Finally, a discussion on the FlowDocument object shows you how to define items that should be flowed across multiple pages as space permits. This lets you display text, graphics, controls, and other items that automatically flow across page breaks. FlowDocument viewers make displaying these documents easy for you, and simplifies the user's reading of the documents. This Wrox Blox also contains 35 example programs written in C# 2008, although most of the code works in previous versions of C# as well. The most notable exceptions are WPF graphics and FlowDocuments, both of which require WPF provided in .NET Framework 3.0 and later. Table of ContentsSection 1: Using Graphics, Pens, and Brushes 2Getting a Graphics Object 3Using a Graphics Object 5Creating Pens 8Creating Brushes 11Section 1 Wrap-up 14Section 2: Using Advanced Pens and Brushes 15Custom Dash Patterns 15Longitudinal Stripes 16Custom End Caps 18Linear Gradient Brushes 19Path Gradient Brushes 21Section 2 Wrap-up 22Section 3: Drawing Text 23Drawing Simple Text 23Using Layout Rectangles 24Section 3 Wrap-up 28Section 4: Manipulating Images 28Creating and Loading Bitmaps 29Manipulating Bitmaps 31Saving Image Files 33Section 4 Wrap-up 35Section 5: Using Transformations 35Basic Transformations 35World Coordinate Mapping 38Section 5 Wrap-up 42Section 6: Printing 42Using PrintPage 43Using Other Event Handlers 46Printing Transformations 48Section 6 Wrap-up 51Section 7: Using WPF Graphics 51Decorative Controls 51Shape Controls 52Brushes 56Section 7 Wrap-up 60Section 8: Building FlowDocuments 60BlockUIContainer 61List 61Paragraph 61Section 61Table 61Section 8 Wrap-up 63Conclusion 64About Rod Stephens 65  Usage Rights for Wiley Wrox Blox  Any Wrox Blox you purchase from this site will come with certain restrictions that allow Wiley to protect the copyrights of its products. After you purchase and download this title,

101 pages, Kindle Edition

First published February 26, 2008

1 person is currently reading

About the author

Rod Stephens

72 books3 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
0 (0%)
4 stars
0 (0%)
3 stars
0 (0%)
2 stars
0 (0%)
1 star
0 (0%)
No one has reviewed this book yet.

Can't find what you're looking for?

Get help and learn more about the design.