O'Reilly logo

3D Programming for Windows® by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Printing in 3D

Printing the contents of a Viewport3D is almost ridiculously easy. In the Windows Presentation Foundation, printing is based on objects of type Visual. Visual is the base class to UIElement, which is the base class to FrameworkElement, which is the base class to Viewport3D, so a Viewport3D certainly qualifies. If all you want to do is print a single Viewport3D object on a printer page, the job is as easy as creating an object of type PrintDialog and calling the PrintVisual method. Printing multiple pages is a bit tougher; see Chapter 17 of my book Applications = Code + Markup for details.

What you'll find, however, is that you're really printing the contents of the Viewport3D object, and that can actually be a problem. Let's look ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required