Printing to scale

Mar 27, 2012 at 4:28 AM
Edited Mar 27, 2012 at 4:29 AM

Hi objo

I am trying to print out to scale from the HelixViewport3D. 

I have an example from the book "3D Programming for Windows by Charles Petzold"

In it he utilises the Viewport3DVisual for printing to be able to control the printing better. ( do you have this book I can post the relevant sections if not). Of course HelixViewport extends Viewport3D so I don't have access to this and am not sure how to get it. 

Is this something you think I can use Helix for, and would this be a good approach. Or can you recommend a better way to print to scale.



Apr 5, 2012 at 12:47 AM

I have not tried this myself, but I understand you have to create a separate Viewport3DVisual to do this (I see Petzold put it inside a VisualBrush with stretch=None). Have you tried temporarily moving the camera and Visual3D contents from the HelixViewport3D to the Viewport3DVisual when you want to print?

Aug 31, 2012 at 11:29 AM

Hi Objo

I have done this and I was thinking it was working fine.

However I have recently found that I can't get text to be printed.

Once I narrow down the issue I will post more. I just wanted to check that you haven't made this work since we had this discussion.



Sep 7, 2012 at 1:28 AM

For anyone else who has this problem. 

We got it working. Basically had to pause the code before creating the image from thh Veiwport3DVisual

  visual3D.Dispatcher.BeginInvoke(new System.Action(() => { })).Wait();
  BitmapSource bitmapSource = RenderBitmap(visual3D, Width, Height, Brushes.White);


It now renders the text correctly