Graphics, Multimedia, and Printing Recipes
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| This article—Graphics, Multimedia, and Printing Recipes—is from Visual C# 2005 Recipes, by Allen Jones, Matthew MacDonald, Rakesh Rajan. Copyright © 2006 Allen Jones, Matthew MacDonald, Rakesh Rajan. All rights reserved. Reproduced by permission. This article has been edited especially for C# Online.NET. Read the book review! |
|
Graphics, Multimedia, and Printing Recipes
Graphics, video, sound, and printing are the hallmarks of a traditional rich client on the Microsoft Windows operating system. When it comes to multimedia, the Microsoft .NET Framework delivers a compromise, providing support for some of these features while ignoring others. For example, you will find a sophisticated set of tools for two-dimensional drawing and event-based printing with GDI+ and the types in the System.Drawing namespaces. These classes wrap GDI32.dll and USER32.DLL, which provide the native Graphics Device Interface (GDI) functions in the Windows application programming interface (API), and they make it much easier to draw complex shapes, work with coordinates and transforms, and process images. On the other hand, if you want to play a sound recording, show a video file, or get information about the current print jobs, you will need to look beyond the .NET Framework.
This chapter presents recipes that show you how to use built-in .NET features and, where necessary, native Win32 libraries via P/Invoke or COM Interop. The recipes in this chapter describe how to do the following:
- Find the fonts installed in your system (recipe 8-1)
- Perform hit testing with shapes (recipe 8-2)
- Create an irregularly shaped form or control (recipe 8-3)
- Creating a sprite that could be moved around (recipe 8-4)
- Display an image that could be made to scroll (recipe 8-5), learn how to capture the image of the desktop (recipe 8-6), and create a thumbnail for an existing image (recipe 8-8)
- Enable double buffering to increase performance while redrawing (recipe 8-7)
- Play a beep or a system-defined sound (recipe 8-9), play a WAV file (recipe 8-10), play a non-WAV file such as an MP3 file (recipe 8-11), and play an animation with DirectShow (recipe 8-12)
- Retrieve information of the printers installed in the machine (recipe 8-13), print a simple document (recipe 8-14), print a document having multiple pages (recipe 8-15), print wrapped text (recipe 8-16), show a print preview (recipe 8-17), and manage print jobs (recipe 8-18)
|


