0

我需要将桌子顺时针旋转 90 度。它是 FlowDocument 的块之一。有没有办法对表格应用某种旋转?
像这样创建 TextEffect 的可能解决方案:


var table = new Table();   
 ... // fill the table here
var effect = new TextEffect  
                 {
                     Transform = new RotationTransform(90),
                     PositionStart = 0,
                     PositionCount = int.MaxValue
                 };
table.TextEffects = new TextEffectCollection();
table.TextEffects.Add(effect);

不起作用。

4

1 回答 1

0

像这样解决:
而不是旋转表,将其放入容器并对其进行旋转。

var container = new BlockUIContainer
                          {
                              Padding = new System.Windows.Thickness(0),
                              Margin = new System.Windows.Thickness(0) 
                          };
var scrollViewer = new FlowDocumentScrollViewer
                       {
                           VerticalScrollBarVisibility = ScrollBarVisibility.Hidden,
                           LayoutTransform = new RotateTransform(90)
                       };
container.Child = scrollViewer;
var tableDocument = new FlowDocument { PagePadding = new System.Windows.Thickness(0) };
// here the table is created
var table = operationStagesControl2.ConvertToXaml();
// adding table to document
tableDocument.Blocks.Add(table);
// hosting scroll viewer gets document
scrollViewer.Document = tableDocument;
// and in the end we have container with rotated table inside it
于 2010-05-11T11:00:38.270 回答