我需要顺时针旋转一个桌子到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);
不起作用。
答案 0 :(得分: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