0

Printing to scale

Anonymous 10 years ago 0
This discussion was imported from CodePlex

murray_b wrote at 2012-03-27 05:28:

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.

thanks

Murray


objo wrote at 2012-04-05 01:47:

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?


murray_b wrote at 2012-08-31 12:29:

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.

thanks

Murray


murray_b wrote at 2012-09-07 02:28:

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