Hi all,

I am currently attempting to rotate a form which is rendering to the screen in 
Landscape to a 
printed page which is Portrait. While I don't think it's that important, the 
dimensions of the form are 
Width=1112, Height=793. The print surface (I am just printing to an XPS file) 
are Width=793, 
Height=1112. I matched the dimensions for simplicity.

Basically, I add a transform group, call a rotate transform (angle 90 degrees), 
translate transform 
to shift the result back onto the "page" and then after setting the transform 
onto the form, I set it 
as the print element.

The result of this is that it does successfully rotate the form - everything 
that I have putting on the 
page is correct and showing up on the page EXCEPT that the page itself is 
clipped at the bottom. 
That is, the page displays as portrait, the content is showing as a landcape 
rotated, but the page 
clips at the bottom so that we only see part of that landscape page. It is as 
though the output 
hasn't been adjusted for the new dimensions, only showing as much as the height 
of the original 
form. I have attached a (very small) example image to show what I mean.

Below is the code I am using. Is there anything that I am doing wrong here?

Regards,
Tony


LandscapePrintTemplateControl landscapeTemplate = new 
LandscapePrintTemplateControl();
landscapeTemplate.Height = e.PrintableArea.Width;
landscapeTemplate.Width = e.PrintableArea.Height;
landscapeTemplate.Title = headingTitle;
//landscapeTemplate.AddChildren(printImageSource);

TransformGroup transformGroup = new TransformGroup();
RotateTransform rotateTransform = new RotateTransform();
rotateTransform.Angle = 90;
transformGroup.Children.Add(rotateTransform);
TranslateTransform moveTransform = new TranslateTransform();
moveTransform.X = e.PrintableArea.Width;
transformGroup.Children.Add(moveTransform);

landscapeTemplate.RenderTransform = transformGroup;

e.PageVisual = landscapeTemplate;

<<attachment: landcape_clipped.png>>

_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to